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 );
30 if ( op->o_ctrls != NULL ) {
31 ldap_controls_free( op->o_ctrls );
34 ldap_pvt_thread_mutex_destroy( &op->o_abandonmutex );
49 op = (Operation *) ch_calloc( 1, sizeof(Operation) );
51 ldap_pvt_thread_mutex_init( &op->o_abandonmutex );
60 op->o_authmech = NULL;
63 op->o_time = slap_get_time();
77 for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
86 slap_op_remove( Operation **olist, Operation *op )
90 for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
94 Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
99 *tmp = (*tmp)->o_next;
105 Operation * slap_op_pop( Operation **olist )
107 Operation *tmp = *olist;
110 *olist = tmp->o_next;