From: Evan Broder Date: Sun, 21 Dec 2008 22:16:38 +0000 (-0600) Subject: Finish the PTS connection initialization code (and deinitialize, too). X-Git-Tag: 0.1.0~80 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-afs.git/commitdiff_plain/e40acda26b3256065d04f9382d01ffe8c9812758 Finish the PTS connection initialization code (and deinitialize, too). Signed-off-by: Evan Broder --- 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)