1 /* abandon.c - decode and handle an ldap abandon operation */
4 * Copyright (c) 1995 Regents of the University of Michigan.
7 * Redistribution and use in source and binary forms are permitted
8 * provided that this notice is preserved and that due credit is given
9 * to the University of Michigan at Ann Arbor. The name of the University
10 * may not be used to endorse or promote products derived from this
11 * software without specific prior written permission. This software
12 * is provided ``as is'' without express or implied warranty.
18 #include <ac/socket.h>
31 Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 );
34 * Parse the abandon request. It looks like this:
36 * AbandonRequest := MessageID
39 if ( ber_scanf( op->o_ber, "i", &id ) == LBER_ERROR ) {
40 Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0 ,0 );
44 Debug( LDAP_DEBUG_ARGS, "do_abandon: id %d\n", id, 0 ,0 );
47 * find the operation being abandoned and set the o_abandon
48 * flag. It's up to the backend to periodically check this
49 * flag and abort the operation at a convenient time.
52 ldap_pvt_thread_mutex_lock( &conn->c_opsmutex );
53 for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
54 if ( o->o_msgid == id )
59 ldap_pvt_thread_mutex_lock( &o->o_abandonmutex );
61 ldap_pvt_thread_mutex_unlock( &o->o_abandonmutex );
63 Debug( LDAP_DEBUG_TRACE, "do_abandon: op not found\n", 0, 0,
66 ldap_pvt_thread_mutex_unlock( &conn->c_opsmutex );