Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] My patch for mod_perl 2.0 in SOAP::Lite 0.6.7

Expand Messages
  • Jay A. Kreibich
    ... Can you re-send this as an attachment, or provide a URL or something? When you pasted it into the body of your message, it line-wrapped and had other
    Message 1 of 2 , Apr 27, 2006
    • 0 Attachment
      On Mon, Apr 24, 2006 at 09:46:49AM -0700, JT Justman scratched on the wall:
      > Hi, everyone.
      >
      > I've just tackled the issue of making SOAP::Lite 0.6.7 work with
      > mod_apache 2.0. The code in 0.6.7 works for 1.0 and 1.99 etc, but not
      > 2.0, due to module naming changes.
      >
      > I basically just manually applied the content of the patch provided by
      > Kyriacos C. Kyriacou on June 15th to work with SOAP::Lite 0.65_6, with
      > modifications for newer code.

      Can you re-send this as an attachment, or provide a URL or something?

      When you pasted it into the body of your message, it line-wrapped and
      had other alterations. I've played with this a bit and can only get
      one of the three hunks to work.

      -j

      --
      Jay A. Kreibich | CommTech, Emrg Net Tech Svcs
      jak@... | Campus IT & Edu Svcs
      <http://www.uiuc.edu/~jak> | University of Illinois at U/C
    • Byrne Reese
      The recent flurry of emails about Apache/mod_perl caught me in a rare moment of free time. I have made a few patches to address these issues. Here is the URL
      Message 2 of 2 , Jun 15, 2006
      • 0 Attachment
        The recent flurry of emails about Apache/mod_perl caught me in a rare
        moment of free time. I have made a few patches to address these issues.

        Here is the URL to an unreleased version of SOAP::Lite (0.68) which I
        would like to ask the community's help in testing.
        http://www.majordojo.com/soaplite/SOAP-Lite-0.68.tar.gz

        If you are using Apache2 and are currently experiencing problems PLEASE
        PLEASE PLEASE HELP ME TEST.

        JT Justman wrote:
        > Hi, everyone.
        >
        > I've just tackled the issue of making SOAP::Lite 0.6.7 work with
        > mod_apache 2.0. The code in 0.6.7 works for 1.0 and 1.99 etc, but not
        > 2.0, due to module naming changes.
        >
        > I basically just manually applied the content of the patch provided by
        > Kyriacos C. Kyriacou on June 15th to work with SOAP::Lite 0.65_6, with
        > modifications for newer code.
        >
        > I also found that I had to 'require APR::Table' in order to get
        > mod_perl2 to play nicely.
        >
        > Your mileage may vary. This has _not_ been tested on older mod_perl.
        >
        > ---PATCH BEGINS---
        > --- HTTP.pm.dist 2006-04-24 07:18:39.000000000 -0700
        > +++ HTTP.pm 2006-04-24 08:56:46.000000000 -0700
        > @@ -519,33 +519,49 @@
        > $self = $class->SUPER::new(@_);
        > SOAP::Trace::objects('()');
        > }
        > - die "Could not find or load mod_perl"
        > - unless (eval "require mod_perl");
        > - die "Could not detect your version of mod_perl"
        > - if (!defined($mod_perl::VERSION));
        > - if ($mod_perl::VERSION < 1.99) {
        > - require Apache;
        > - require Apache::Constants;
        > - Apache::Constants->import('OK');
        > - $self->{'MOD_PERL_VERSION'} = 1;
        > - } elsif ($mod_perl::VERSION < 3) {
        > - require Apache::RequestRec;
        > - require Apache::RequestIO;
        > - require Apache::Const;
        > - Apache::Const->import(-compile => 'OK');
        > - $self->{'MOD_PERL_VERSION'} = 2;
        > - } else {
        > - die "Unsupported version of mod_perl";
        > - }
        > + if( defined $ENV{MOD_PERL_API_VERSION} && $ENV {MOD_PERL_API_VERSION}
        > >= 2) { # mod_perl 2.0
        > + require Apache2::RequestRec;
        > + require Apache2::RequestIO;
        > + require Apache2::Const;
        > + require APR::Table;
        > + Apache2::Const->import(-compile => 'OK');
        > $self->{'MOD_PERL_VERSION'} = 2;
        > + $self->{OK} = &Apache2::Const::OK;
        > + } else { # mod_perl 1.xx
        > + die "Could not find or load mod_perl"
        > + unless (eval "require mod_perl");
        > + die "Could not detect your version of mod_perl"
        > + if (!defined($mod_perl::VERSION));
        > + if ($mod_perl::VERSION < 1.99) {
        > + require Apache;
        > + require Apache::Constants;
        > + Apache::Constants->import('OK');
        > + $self->{'MOD_PERL_VERSION'} = 1;
        > + $self->{OK} = &Apache::Constants::OK;
        > + } else {
        > + require Apache::RequestRec;
        > + require Apache::RequestIO;
        > + require Apache::Const;
        > + Apache::Const->import(-compile => 'OK');
        > + $self->{'MOD_PERL_VERSION'} = 1.99;
        > + $self->{OK} = &Apache::OK;
        > + }
        > + }
        > return $self;
        > }
        >
        > sub handler {
        > my $self = shift->new;
        > my $r = shift;
        > - $r = Apache->request if (!$r && $self->{'MOD_PERL_VERSION'} == 1);
        >
        > - if ($r->header_in('Expect') =~ /\b100-Continue\b/i) {
        > + if(!$r) {
        > + if( $self->{'MOD_PERL_VERSION'} < 2 ) { $r = Apache->request() }
        > + else { $r = Apache2::RequestUtil->request() }
        > + }
        > +
        > + my $cont_len;
        > + if( $self->{'MOD_PERL_VERSION'} == 1 ) { $cont_len = $r->header_in
        > ('Content-length') }
        > + else { $cont_len =
        > $r->headers_in->get('Content-length') }
        > + if ($r->headers_in->{'Expect'} =~ /\b100-Continue\b/i) {
        > $r->print("HTTP/1.1 100 Continue\r\n\r\n");
        > }
        >
        > @@ -554,7 +570,7 @@
        > HTTP::Headers->new($r->headers_in),
        > do {
        > my ($c,$buf);
        > - while ($r->read($buf,$r->header_in('Content-length'))) {
        > + while ($r->read($buf, $cont_len)) {
        > $c.=$buf;
        > }
        > $c;
        > @@ -569,10 +585,15 @@
        > # will emulate normal response, but with custom status code
        > # which could also be 500.
        > $r->status($self->response->code);
        > - $self->response->headers->scan(sub { $r->header_out(@_) });
        > - $r->send_http_header(join '; ', $self->response->content_type);
        > + if ( $self->{'MOD_PERL_VERSION'} > 1 ) {
        > + $self->response->headers->scan(sub { $r->headers_out->set(@_) });
        > + $r->content_type(join '; ', $self->response->content_type);
        > + } else {
        > + $self->response->headers->scan(sub { $r->header_out(@_) });
        > + $r->send_http_header(join '; ', $self->response->content_type);
        > + }
        > $r->print($self->response->content);
        > - return $self->{'MOD_PERL_VERSION'} == 2 ? &Apache::OK :
        > &Apache::Constants::OK;
        > + return $self->{OK};
        > }
        >
        > sub configure {
        >
        >
        >
        > --
        > |Waiting to fix the world since 1995|
        > "Progress isn't made by early risers. It's made by lazy men trying to
        > find easier ways to do something."
        > - Robert Heinlein
        >
        >
        > SPONSORED LINKS
        > Protocol analyzer
        > <http://groups.yahoo.com/gads?t=ms&k=Protocol+analyzer&w1=Protocol+analyzer&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6=Protocol&c=6&s=120&.sig=-vNi0F9sGxz3wJiUypOlsA>
        > Ssl protocol
        > <http://groups.yahoo.com/gads?t=ms&k=Ssl+protocol&w1=Protocol+analyzer&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6=Protocol&c=6&s=120&.sig=QcUDWIbIdXkmz4QSFhqszw>
        > Protocol converter
        > <http://groups.yahoo.com/gads?t=ms&k=Protocol+converter&w1=Protocol+analyzer&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6=Protocol&c=6&s=120&.sig=8MMcEvfzdk5saYSJv-2g3g>
        >
        > Sip protocol
        > <http://groups.yahoo.com/gads?t=ms&k=Sip+protocol&w1=Protocol+analyzer&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6=Protocol&c=6&s=120&.sig=X7aZ6IACnEQUtAC57u829w>
        > Protocol analysis
        > <http://groups.yahoo.com/gads?t=ms&k=Protocol+analysis&w1=Protocol+analyzer&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6=Protocol&c=6&s=120&.sig=SI1LEHwb69y6gddZAv_Fuw>
        > Protocol
        > <http://groups.yahoo.com/gads?t=ms&k=Protocol&w1=Protocol+analyzer&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6=Protocol&c=6&s=120&.sig=aCiMFP0b3kFn96wqrZacGA>
        >
        >
        >
        > ------------------------------------------------------------------------
        > YAHOO! GROUPS LINKS
        >
        > * Visit your group "soaplite
        > <http://groups.yahoo.com/group/soaplite>" on the web.
        >
        > * To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        > <mailto:soaplite-unsubscribe@yahoogroups.com?subject=Unsubscribe>
        >
        > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        > Service <http://docs.yahoo.com/info/terms/>.
        >
        >
        > ------------------------------------------------------------------------
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.