use Sip::MsgType;
use File::Queue;
-use Storable qw(freeze thaw);
+use FreezeThaw qw(freeze thaw);
my $mp_fifo = File::Queue->new( File => "/tmp/SIPServer.mulitplex-fifo.$$" );
END { $mp_fifo->delete };
my %active_connections;
sub PERMAFROST {
while (my $login = $mp_fifo->deq) {
- $login = thaw($login);
+ ($login) = thaw($login);
my $c = $$login{id};
if ($$login{success}) {
$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})
- );
+ for my $p (keys %{ $$login{net_server_parts} }) {
+ $active_connections{$c}{net_server}{$p} =
+ $$login{net_server_parts}{$p};
+ }
} else {
delete $active_connections{$c};
}
}
# We stick this here, assuming success. Cleanup comes later via PERMAFROST().
- $active_connections{$conn_id} = { id => $conn_id, transport => $transport };
+ $active_connections{$conn_id} = { id => $conn_id, transport => $transport, net_server => $self };
my $pid = fork();
if (!defined($pid) or $pid < 0) {
success => $success,
transport => $transport,
net_server_parts => {
- %$self{ wq/service ils state institution account/ }
+ %$self{ qw/ils state institution account/ }
}
})
);