Blob Blame History Raw
--- Frontier-RPC-0.07b4p1/lib/Apache/XMLRPC.pm.apache2     2007-11-08 17:01:28.000000000 +0100
+++ Frontier-RPC-0.07b4p1/lib/Apache/XMLRPC.pm  2007-11-08 17:24:46.000000000 +0100
@@ -10,16 +10,18 @@

 package Apache::XMLRPC;

-use Apache::Constants qw(:common);
+use Apache2::Const;
+use Apache2::ServerUtil;
 use Frontier::RPC2;

 sub handler {
    my $r = shift;

-   my $conf = $r->server_root_relative( $r->dir_config( "XMLRPC_Config" ) );
+   my $path = $r->dir_config( "XMLRPC_Config" );
+   my $conf = Apache2::ServerUtil::server_root_relative( $r->pool, $path );

    if( -f $conf ) {
-      unless( $rt = do $conf ) {
+      unless( my $rt = do $conf ) {
          die "Couldn\'t parse conf file ($conf): $@\n"   if $@;
          die "Couldn\'t compile conf file ($conf): $!\n" unless defined $rt;
          die "Couldn\'t run conf file ($conf)\n"         unless $rt;
@@ -28,15 +30,16 @@

    my $decoder = Frontier::RPC2->new();

-   my $content;
-   $r->read( $content, $r->header_in( 'Content-length' ) );
+   if (defined $clength and $clength >= 0) {
+       my $content;
+       $r->read( $content, $r->headers_in->{'Content-length'} );

-   my $answer = $decoder->serve( $content, $Apache::XMLRPC::map );
+        my $answer = $decoder->serve( $content, $Apache::XMLRPC::map );

-   $r->send_http_header();
-   $r->print($answer);
+        $r->print($answer);
+   }

-   return OK;
+   return Apache2::Const::OK();
 }

 1;