LP#1927542: fix incorrect ACS Status response in Multiplex mode user/gmcharlt/lp1927542_fix_acs_status_in_multiplex
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 6 May 2021 20:00:33 +0000 (16:00 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 6 May 2021 20:03:59 +0000 (16:03 -0400)
This patch fixes an issue where the serialization and deserialization
of the SIP server object when handling a pending ILS login connection
can cause the ACS Status message handler to not have access to the
institution configuration settings for the timeout and retry policy,
causing it to return 000 for both values. This can lead to some
SIP2 clients believing that the ACS is either offline or impossibly
fast.

To test
-------
[1] Set up SIPServer to use the Multiplex personality.
[2] With an appropriate ILS connect set up, send the following
    messages

9900402.00 => response should show default timeout of 600 and
              retry limit of 003
9300CN_user_|CO_password_|CP_institution_ => should get 941 response
9900402.00 => response shows a timeout of 000 and retry limit
              of 000

[3] Apply the patch and repeat step 2. This time, both message
    98 responses should show a timeout of 600 and retry limit of
    003.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
SIPServer.pm

index 0e36676..f1a9664 100755 (executable)
@@ -409,7 +409,7 @@ sub mux_input {
 
                     $cache_data->{success} = 1;
                     $cache_data->{net_server_parts} = {
-                        map { ($_ => $$self{$_}) } qw/state institution account/
+                        map { ($_ => $$self{$_}) } qw/state institution account policy/
                     };
 
                     # Stash the ILS module somewhere handy for later
@@ -419,6 +419,10 @@ sub mux_input {
                     $cache_data->{success} = 0;
                 }
 
+                # guarantee that the nested structure we're passing wil
+                # be reconstructed correctly even in the face of hash
+                # randomization
+                local $Data::Dumper::Purity = 1;
                 init_cache()->set(
                     "sip_pending_auth_$conn_id", 
                     Data::Dumper->Dump([$cache_data]),