From: Mike Rylander Date: Wed, 9 Oct 2013 15:34:23 +0000 (-0400) Subject: LP#1339190 Allow the ILS to save state in IO::Multiplex mode X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=de26d78c0f59664eb7cbba2f9aab8b1fd7fd794a;p=working%2FSIPServer.git LP#1339190 Allow the ILS to save state in IO::Multiplex mode Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- diff --git a/SIPServer.pm b/SIPServer.pm index 7b0e1a2..669f6fd 100644 --- a/SIPServer.pm +++ b/SIPServer.pm @@ -254,6 +254,10 @@ sub mux_input { # Stash the ILS module somewhere handy for later $active_connections{$conn_id}->{ils} = ref($self->{ils}); + + # And, if the ILS module wants to save some state, allow that + $active_connections{$conn_id}->{state} = $self->{ils}->state() if (UNIVERSAL::can($self->{ils},'state'));; + delete $$self{ils}; my $c = scalar(keys %active_connections); @@ -273,7 +277,7 @@ sub mux_input { if ($pid == 0) { # in kid # build the connection we deleted after logging in - $self->{ils} = $active_connections{$conn_id}->{ils}->new($self->{institution}, $self->{account}); + $self->{ils} = $active_connections{$conn_id}->{ils}->new($self->{institution}, $self->{account}, $active_connections{$conn_id}->{state}); if (!$self->{ils}) { syslog('LOG_ERR', "Unable to build ILS module in mux child");