1 /* operation.c - routines to deal with pending ldap operations */
14 op_free( Operation *op )
16 if ( op->o_ber != NULL )
17 ber_free( op->o_ber, 1 );
18 if ( op->o_dn != NULL ) {
21 /* pthread_mutex_destroy( &op->o_abandonmutex ); */
38 for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
41 *tmp = (Operation *) calloc( 1, sizeof(Operation) );
42 pthread_mutex_init( &(*tmp)->o_abandonmutex,
43 pthread_mutexattr_default );
45 (*tmp)->o_msgid = msgid;
47 (*tmp)->o_abandon = 0;
48 (*tmp)->o_dn = ch_strdup( dn != NULL ? dn : "" );
49 pthread_mutex_lock( ¤ttime_mutex );
50 (*tmp)->o_time = currenttime;
51 pthread_mutex_unlock( ¤ttime_mutex );
53 (*tmp)->o_connid = connid;
54 (*tmp)->o_next = NULL;
60 op_delete( Operation **olist, Operation *op )
64 for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
68 Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
73 *tmp = (*tmp)->o_next;