From: Bill Erickson Date: Tue, 8 Oct 2013 17:37:54 +0000 (-0400) Subject: LP#1339190 Log and exit gracefully ILS re-init failure in mux handler X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ca09c90ac8a82c4dd932a17346f51b12c181102c;p=working%2FSIPServer.git LP#1339190 Log and exit gracefully ILS re-init failure in mux handler Signed-off-by: Bill Erickson --- diff --git a/SIPServer.pm b/SIPServer.pm index 495cb98..7b0e1a2 100644 --- a/SIPServer.pm +++ b/SIPServer.pm @@ -170,7 +170,7 @@ sub process_request { # Multiplex. my %kid_hash; -my $kid_count; +my $kid_count = 0; sub REAPER { for (keys(%kid_hash)) { @@ -275,6 +275,11 @@ sub mux_input { # build the connection we deleted after logging in $self->{ils} = $active_connections{$conn_id}->{ils}->new($self->{institution}, $self->{account}); + if (!$self->{ils}) { + syslog('LOG_ERR', "Unable to build ILS module in mux child"); + exit(0); + } + # build the connection we deleted after logging in my $input = Sip::read_SIP_packet($str_fh); $input =~ s/[\r\n]+$//sm; # Strip off any trailing line ends @@ -299,7 +304,7 @@ sub mux_input { sub mux_close { my ($self, $mux, $fh) = @_; delete $active_connections{''.$fh}; - syslog("LOG_DEBUG", "multi: cleaning up child: $fh; ". + syslog("LOG_DEBUG", "multi: mux_close cleaning up child: $fh; ". scalar(keys %active_connections)." remain"); }