From de26d78c0f59664eb7cbba2f9aab8b1fd7fd794a Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 9 Oct 2013 11:34:23 -0400 Subject: [PATCH] LP#1339190 Allow the ILS to save state in IO::Multiplex mode Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- SIPServer.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"); -- 2.11.0