1 /* operation.c - routines to deal with pending ldap operations */
14 slap_op_free( Operation *op )
16 if ( op->o_ber != NULL )
17 ber_free( op->o_ber, 1 );
18 if ( op->o_dn != NULL ) {
21 if ( op->o_ndn != NULL ) {
24 /* pthread_mutex_destroy( &op->o_abandonmutex ); */
41 for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
44 *tmp = (Operation *) calloc( 1, sizeof(Operation) );
45 pthread_mutex_init( &(*tmp)->o_abandonmutex,
46 pthread_mutexattr_default );
48 (*tmp)->o_msgid = msgid;
50 (*tmp)->o_abandon = 0;
52 (*tmp)->o_dn = ch_strdup( dn != NULL ? dn : "" );
53 (*tmp)->o_ndn = dn_normalize_case( ch_strdup( (*tmp)->o_dn ) );
55 pthread_mutex_lock( ¤ttime_mutex );
56 (*tmp)->o_time = currenttime;
57 pthread_mutex_unlock( ¤ttime_mutex );
59 (*tmp)->o_connid = connid;
60 (*tmp)->o_next = NULL;
66 slap_op_delete( Operation **olist, Operation *op )
70 for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
74 Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
79 *tmp = (*tmp)->o_next;