Description: Net::Server 2.x compatibility
Origin: vendor
Forwarded: no
Author: Niko Tyni <ntyni@debian.org>
Last-Update: 2012-06-25

Newer versions of Net::Server bless the client connection to a subclass
like Net::Server::Proto::TCP, breaking the check for an already blessed
HTTP::Daemon::ClientConn and making all connections fail with errors like

 Can't locate object method "get_request" via package "Net::Server::Proto::TCP" at /home/niko/tmp/librpc-xml-perl-0.76/blib/lib/RPC/XML/Server.pm line 828.

(Example: http://bugs.debian.org/678767)

Explicitly test for the get_request method that we need
from HTTP::Daemon::ClientConn.
---
 lib/RPC/XML/Server.pm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/RPC/XML/Server.pm b/lib/RPC/XML/Server.pm
index 97a8c03..55c59c5 100644
--- a/lib/RPC/XML/Server.pm
+++ b/lib/RPC/XML/Server.pm
@@ -798,7 +798,7 @@ sub process_request ## no critic (ProhibitExcessComplexity)
     );
 
     my $me = ref($self) . '::process_request';
-    if (! ($conn && ref $conn))
+    if (! ($conn && ref $conn && $conn->can('get_request')))
     {
         $conn = $self->{server}->{client};
         bless $conn, 'HTTP::Daemon::ClientConn';
