Author: ArcRiley
Date: 2009-01-07 15:25:42 -0500 (Wed, 07 Jan 2009)
New Revision: 1437

Modified:
   trunk/concordance/src/Core.c
   trunk/concordance/src/Core.h
Log:
gsasl context init and free


Modified: trunk/concordance/src/Core.c
===================================================================
--- trunk/concordance/src/Core.c        2009-01-07 19:29:58 UTC (rev 1436)
+++ trunk/concordance/src/Core.c        2009-01-07 20:25:42 UTC (rev 1437)
@@ -48,6 +48,7 @@
       self->s2s.sock = -1;
       self->context  = NULL;
       self->mainloop = NULL;
+      self->saslCntx = NULL;
     }
     return (PyObject*) self;
   }
@@ -164,6 +165,15 @@
     self->channels = g_hash_table_new_full(g_direct_hash, g_direct_equal,
                                            NULL, NULL);
 
+    /* initialize gsasl context
+
+       int              gsasl_init               (Gsasl** ctx)
+    */
+    if (gsasl_init(&self->saslCntx) != GSASL_OK) {
+      PyErr_SetString(PyExc_MemoryError, "out of memory on gsasl_init");
+      return -1;
+    }
+
     /* launch GMainLoop thread before returning
 
        GThread*    g_thread_create     (GThreadFunc func,
@@ -185,6 +195,14 @@
       close(self->c2s.sock);
     if (self->s2s.sock > -1)
       close(self->s2s.sock);
+
+    if (self->saslCntx != NULL)
+      /* free gsasl context
+
+         void           gsasl_done               (Gsasl* ctx);
+      */
+      gsasl_done(self->saslCntx);
+
     PyObject_Del(self);
   }
 

Modified: trunk/concordance/src/Core.h
===================================================================
--- trunk/concordance/src/Core.h        2009-01-07 19:29:58 UTC (rev 1436)
+++ trunk/concordance/src/Core.h        2009-01-07 20:25:42 UTC (rev 1437)
@@ -54,6 +54,7 @@
   GMainContext*    context;            /* each Core has it's own Glib context 
*/
   GMainLoop*       mainloop;           /* handle to this core's Glim mainloop 
*/
   GThread*         thread;             /* thread ID for mainloop thread */
+  Gsasl*           saslCntx;           /* sasl context for this Core */
 } conCoreObject;
 
 

_______________________________________________
PySoy-SVN mailing list
PySoy-SVN@pysoy.org
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to