1 /* operation.c - routines to deal with pending ldap operations */
14 slap_op_free( Operation *op )
16 assert( op->o_next == NULL );
18 if ( op->o_ber != NULL ) {
19 ber_free( op->o_ber, 1 );
21 if ( op->o_dn != NULL ) {
24 if ( op->o_ndn != NULL ) {
27 if ( op->o_authmech != NULL ) {
28 free( op->o_authmech );
31 ldap_pvt_thread_mutex_destroy( &op->o_abandonmutex );
46 op = (Operation *) ch_calloc( 1, sizeof(Operation) );
48 ldap_pvt_thread_mutex_init( &op->o_abandonmutex );
57 op->o_authmech = NULL;
59 op->o_time = slap_get_time();
73 for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
82 slap_op_remove( Operation **olist, Operation *op )
86 for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
90 Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
95 *tmp = (*tmp)->o_next;
101 Operation * slap_op_pop( Operation **olist )
103 Operation *tmp = *olist;
106 *olist = tmp->o_next;