Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RT#65616: Fix for slow methods killing servers.

Applied and modified patch from person who opened the ticket.
  • Loading branch information...
commit cc02b294421a3b343ac741fdd4ceb11349626972 1 parent 8008995
Randy J. Ray authored
Showing with 14 additions and 3 deletions.
  1. +14 −3 lib/RPC/XML/Server.pm
17 lib/RPC/XML/Server.pm
View
@@ -110,7 +110,7 @@ BEGIN
);
}
-$VERSION = '1.67';
+$VERSION = '1.68';
$VERSION = eval $VERSION; ## no critic (ProhibitStringyEval)
###############################################################################
@@ -616,7 +616,8 @@ sub server_loop ## no critic (RequireArgUnpacking,ProhibitExcessComplexity)
if ($self->{__daemon})
{
- my ($conn, $req, $resp, $reqxml, $respxml, $exit_now, $timeout);
+ my ($conn, $req, $resp, $reqxml, $respxml, $exit_now, $timeout,
+ $eval_return);
my %args = @_;
@@ -652,7 +653,17 @@ sub server_loop ## no critic (RequireArgUnpacking,ProhibitExcessComplexity)
}
$conn->timeout($self->timeout);
$self->process_request($conn);
- $conn->close;
+
+ $eval_return = eval {
+ local $SIG{PIPE} = sub { die "server_loop: Caught SIGPIPE\n"; };
+ $conn->close;
+ 1;
+ };
+ if ((! $eval_return) && $@)
+ {
+ warn "Cannot close conection: $@\n";
+ }
+
undef $conn; # Free up any lingering resources
}
Please sign in to comment.
Something went wrong with that request. Please try again.