LP1901930 Respond to end-session message
authorBill Erickson <berickxx@gmail.com>
Thu, 10 Jun 2021 20:25:05 +0000 (13:25 -0700)
committerBill Erickson <berickxx@gmail.com>
Mon, 24 Oct 2022 17:21:58 +0000 (13:21 -0400)
Send a response to the mediators 'XS' end session message so the
mediators knows when it's safe to shut down its HTTP connection to us.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm

index 887de63..e203f06 100644 (file)
@@ -49,7 +49,6 @@ __PACKAGE__->register_method(
 
 sub dispatch_sip2_request {
     my ($self, $client, $seskey, $message) = @_;
-
     OpenSRF::AppSession->ingress('sip2');
 
     return OpenILS::Event->new('SIP2_SESSION_REQUIRED') unless $seskey;
@@ -91,13 +90,14 @@ sub handle_end_session {
     my ($session, $message) = @_;
     my $e = $session->editor;
     my $seskey = $session->seskey;
+    my $resp = {code => 'XT'};
 
     $SC->cache->delete_cache("sip2_$seskey");
 
     $U->simplereq('open-ils.auth', 
         'open-ils.auth.session.delete', $e->authtoken);
 
-    return undef if $U->is_true($session->sip_account->transient);
+    return $resp if $U->is_true($session->sip_account->transient);
 
     $e->xact_begin;
     my $ses = $e->retrieve_sip_session($seskey);
@@ -108,7 +108,7 @@ sub handle_end_session {
         $e->rollback;
     }
 
-    return undef;
+    return $resp;
 }
 
 # Login to Evergreen and cache the login data.