[JDEV] xdb / mod_groups problem

Phil Anderson p.anderson3 at ugrad.unimelb.edu.au
Sun Sep 23 11:39:50 CDT 2001


I've spent the last day looking, fixing, and enhancing mod_groups.  I'm
currently trying to add support for unregistering from a group, but have
hit a problem with the xdb api.

How do I delete data from xdb?  I thought that you would pass a NULL
pointer to xdb_act (which is what the function header suggests), but on
the 4th line of code, the function fails if a NULL pointer has been
passed?  What is the proper way of doing this?

Phil



/* match will find a child in the parent, and either replace (if it's an
insert) or remove (if data is NULL) */
int xdb_act(xdbcache xc, jid owner, char *ns, char *act, char *match,
xmlnode data)
{
    _xdbcache newx;
    pth_mutex_t mutex = PTH_MUTEX_INIT;
    pth_cond_t cond = PTH_COND_INIT;

    if(xc == NULL || owner == NULL || ns == NULL || data == NULL)
    {
        fprintf(stderr,"Programming Error: xdb_set() called with
NULL\n");

        return 1;
    }

    ...
}



More information about the JDev mailing list