WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 6 of 7] CA-34933: test for valid session when calling b

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH 6 of 7] CA-34933: test for valid session when calling back master
From: Marcus Granado <marcus.granado@xxxxxxxxxx>
Date: Fri, 21 May 2010 14:46:09 +0100
Delivery-date: Fri, 21 May 2010 06:58:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1274449563@localhost>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1274449563@localhost>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
 ocaml/xapi/helpers.ml |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


# HG changeset patch
# User Marcus Granado <marcus.granado@xxxxxxxxxx>
# Date 1274449016 -3600
# Node ID a402deb8e3cfdccc5fd3383d7fb96a76a07917a2
# Parent  2cb0cc2a496431b098d0cd44fbb7c33a9ac82f78
CA-34933: test for valid session when calling back master

Signed-off-by: Marcus Granado <marcus.granado@xxxxxxxxxxxxx>

diff -r 2cb0cc2a4964 -r a402deb8e3cf ocaml/xapi/helpers.ml
--- a/ocaml/xapi/helpers.ml
+++ b/ocaml/xapi/helpers.ml
@@ -124,7 +124,11 @@
           then session_id
           else do_master_login ()
       end 
-      else Context.get_session_id __context
+      else
+          let session_id = Context.get_session_id __context in
+          (* read any attr to test if session is still valid *)
+          Db.Session.get_pool ~__context ~self:session_id;
+          session_id
       with _ -> 
       do_master_login ()
   in

Attachment: xen-api.hg-6.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api