be96c89
--- Frontier-RPC-0.07b4p1/lib/Apache/XMLRPC.pm.apache2     2007-11-08 17:01:28.000000000 +0100
be96c89
+++ Frontier-RPC-0.07b4p1/lib/Apache/XMLRPC.pm  2007-11-08 17:24:46.000000000 +0100
be96c89
@@ -10,16 +10,18 @@
be96c89
be96c89
 package Apache::XMLRPC;
be96c89
be96c89
-use Apache::Constants qw(:common);
be96c89
+use Apache2::Const;
be96c89
+use Apache2::ServerUtil;
be96c89
 use Frontier::RPC2;
be96c89
be96c89
 sub handler {
be96c89
    my $r = shift;
be96c89
be96c89
-   my $conf = $r->server_root_relative( $r->dir_config( "XMLRPC_Config" ) );
be96c89
+   my $path = $r->dir_config( "XMLRPC_Config" );
be96c89
+   my $conf = Apache2::ServerUtil::server_root_relative( $r->pool, $path );
be96c89
be96c89
    if( -f $conf ) {
be96c89
-      unless( $rt = do $conf ) {
be96c89
+      unless( my $rt = do $conf ) {
be96c89
          die "Couldn\'t parse conf file ($conf): $@\n"   if $@;
be96c89
          die "Couldn\'t compile conf file ($conf): $!\n" unless defined $rt;
be96c89
          die "Couldn\'t run conf file ($conf)\n"         unless $rt;
be96c89
@@ -28,15 +30,16 @@
be96c89
be96c89
    my $decoder = Frontier::RPC2->new();
be96c89
be96c89
-   my $content;
be96c89
-   $r->read( $content, $r->header_in( 'Content-length' ) );
be96c89
+   if (defined $clength and $clength >= 0) {
be96c89
+       my $content;
be96c89
+       $r->read( $content, $r->headers_in->{'Content-length'} );
be96c89
be96c89
-   my $answer = $decoder->serve( $content, $Apache::XMLRPC::map );
be96c89
+        my $answer = $decoder->serve( $content, $Apache::XMLRPC::map );
be96c89
be96c89
-   $r->send_http_header();
be96c89
-   $r->print($answer);
be96c89
+        $r->print($answer);
be96c89
+   }
be96c89
be96c89
-   return OK;
be96c89
+   return Apache2::Const::OK();
be96c89
 }
be96c89
be96c89
 1;