From e40acda26b3256065d04f9382d01ffe8c9812758 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sun, 21 Dec 2008 16:16:38 -0600 Subject: [PATCH 1/1] Finish the PTS connection initialization code (and deinitialize, too). Signed-off-by: Evan Broder --- afs/_pts.pyx | 5 +++++ afs/afs.pxd | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/afs/_pts.pyx b/afs/_pts.pyx index df7397c..65f0140 100644 --- a/afs/_pts.pyx +++ b/afs/_pts.pyx @@ -67,7 +67,12 @@ cdef class PTS: sc, sec) + code = ubik_ClientInit(serverconns, &self.client) + if code != 0: + raise Exception("Failed to initialize ubik connection to Protection server: %s" % error_message(code)) + code = rxs_Release(sc) def __dealloc__(self): + ubik_ClientDestroy(self.client) rx_Finalize() diff --git a/afs/afs.pxd b/afs/afs.pxd index 06cf0d7..b4057c8 100644 --- a/afs/afs.pxd +++ b/afs/afs.pxd @@ -52,14 +52,6 @@ cdef extern from "afs/cellconfig.h": char *aservice, afsconf_cell *acellInfo) -cdef extern from "ubik.h": - enum: - MAXSERVERS - - # ubik_client is an opaque struct, so we don't care about its members - struct ubik_client: - pass - cdef extern from "rx/rxkad.h": ctypedef char rxkad_level @@ -123,5 +115,17 @@ cdef extern from "afs/prclient.h": enum: PRSRV +cdef extern from "ubik.h": + enum: + MAXSERVERS + + # ubik_client is an opaque struct, so we don't care about its members + struct ubik_client: + pass + + int ubik_ClientInit(rx_connection **serverconns, + ubik_client **aclient) + afs_int32 ubik_ClientDestroy(ubik_client *aclient) + cdef extern from "afs/com_err.h": char * error_message(int) -- 1.7.9.5