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 );
47 for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
50 *tmp = (Operation *) ch_calloc( 1, sizeof(Operation) );
52 ldap_pvt_thread_mutex_init( &(*tmp)->o_abandonmutex );
54 (*tmp)->o_msgid = msgid;
56 (*tmp)->o_abandon = 0;
58 (*tmp)->o_dn = ch_strdup( dn != NULL ? dn : "" );
59 (*tmp)->o_ndn = dn_normalize_case( ch_strdup( (*tmp)->o_dn ) );
61 ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
62 (*tmp)->o_time = currenttime;
63 ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
65 (*tmp)->o_connid = connid;
66 (*tmp)->o_next = NULL;
72 slap_op_delete( Operation **olist, Operation *op )
76 for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
80 Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
86 *tmp = (*tmp)->o_next;