1 /* operation.c - routines to deal with pending ldap operations */
14 slap_op_free( Operation *op )
16 ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
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 ) {
28 ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
29 ldap_pvt_thread_mutex_destroy( &op->o_abandonmutex );
46 for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
49 *tmp = (Operation *) ch_calloc( 1, sizeof(Operation) );
51 ldap_pvt_thread_mutex_init( &(*tmp)->o_abandonmutex );
53 (*tmp)->o_msgid = msgid;
55 (*tmp)->o_abandon = 0;
57 (*tmp)->o_dn = ch_strdup( dn != NULL ? dn : "" );
58 (*tmp)->o_ndn = dn_normalize_case( ch_strdup( (*tmp)->o_dn ) );
60 ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
61 (*tmp)->o_time = currenttime;
62 ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
64 (*tmp)->o_connid = connid;
65 (*tmp)->o_next = NULL;
71 slap_op_delete( Operation **olist, Operation *op )
75 for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
79 Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
85 *tmp = (*tmp)->o_next;