pull just what we need, merge it later
authorMike Rylander <mrylander@gmail.com>
Fri, 25 Jul 2014 19:47:01 +0000 (15:47 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 8 Aug 2014 14:08:37 +0000 (10:08 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
SIPServer.pm

index 071a3ad..272e27d 100644 (file)
@@ -193,10 +193,23 @@ my %active_connections;
 sub PERMAFROST {
     while (my $login = $mp_fifo->deq) {
         $login = thaw($login);
+
+        my $c = $$login{id};
         if ($$login{success}) {
-            $active_connections{$$login{id}} = $login;
+            $active_connections{$c}{config} = $config;
+
+            $active_connections{$c}{id} = $$login{id};
+            $active_connections{$c}{transport} = $$login{transport};
+
+            $active_connections{$c}{net_server} = bless(
+                { # Last wins
+                    %{ $active_connections{$c}{net_server} },
+                    %{ $$login{net_server_parts} }
+                },
+                ref($active_connections{$c}{net_server})
+            );
         } else {
-            delete $active_connections{$$login{id}};
+            delete $active_connections{$c};
         }
     }
 }
@@ -293,7 +306,9 @@ sub mux_input {
                     id => $conn_id,
                     success => $success,
                     transport  => $transport,
-                    net_server => bless({%$self}, ref($self))
+                    net_server_parts => {
+                        %$self{ wq/service ils state institution account/ }
+                    }
                 })
             );