if (! defined($self->{service})) {
syslog( "LOG_ERR", "process_request: Unrecognized server connection: %s:%s/%s",
$sockaddr, $port, $proto );
- die "process_request: Bad server connection";
+ syslog('LOG_ERR', "process_request: Bad server connection");
+ return;
}
my $transport = $transports{ $self->{service}->{transport} };
return;
}
- &$transport($self, $str_fh);
+ eval { &$transport($self, $str_fh) };
+ if ($@) {
+ syslog('LOG_ERR', "ILS login error: $@");
+ return;
+ }
$active_connections{$conn_id} =
{ id => $conn_id,
$self = $active_connections{$conn_id}->{net_server};
my $pid = fork();
- die "Cannot fork: $!" unless (defined($pid) && $pid > -1);
+ if (!defined($pid) or $pid < 0) {
+ syslog('LOG_ERR', "Unable to fork new child process $!");
+ return;
+ }
if ($pid == 0) { # in kid
sub mux_close {
my ($self, $mux, $fh) = @_;
delete $active_connections{''.$fh};
- syslog("LOG_DEBUG", "multi: cleaning up child: $fh");
+ syslog("LOG_DEBUG", "multi: cleaning up child: $fh; ".
+ scalar(keys %active_connections)." remain");
}