From: Mike Rylander Date: Wed, 9 Oct 2013 15:34:23 +0000 (-0400) Subject: Allow the ILS to save state in IO::Multiplex mode X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fberick%2Fsip2-support-multiplex-personality;p=working%2FSIPServer.git Allow the ILS to save state in IO::Multiplex mode Signed-off-by: Mike Rylander --- diff --git a/SIPServer.pm b/SIPServer.pm index 20656f5..b77ab34 100644 --- a/SIPServer.pm +++ b/SIPServer.pm @@ -251,6 +251,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); @@ -270,7 +274,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");