Save state in the new world
authorMike Rylander <mrylander@gmail.com>
Fri, 25 Jul 2014 19:15:05 +0000 (15:15 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 8 Aug 2014 14:08:36 +0000 (10:08 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
SIPServer.pm

index a3595a5..9c5aa84 100644 (file)
@@ -280,6 +280,9 @@ sub mux_input {
                 exit(0);
             }
     
+            # Grab any state data for later
+            $self->{state} = $self->{ils}->state() if (UNIVERSAL::can($self->{ils},'state'));
+
             # Evergreen, at least, needs a chance to clean up before forking for other requests
             $self->{ils}->disconnect() if (UNIVERSAL::can($self->{ils},'disconnect'));
 
@@ -312,7 +315,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}, $active_connections{$conn_id}->{state});
+        $self->{ils} = $active_connections{$conn_id}->{ils}->new($self->{institution}, $self->{account}, $self->{state});
 
         if (!$self->{ils}) {
             syslog('LOG_ERR', "Unable to build ILS module in mux child");