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>
22 extern Backend *select_backend();
24 extern char *default_referral;
36 Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 );
39 * Parse the abandon request. It looks like this:
41 * AbandonRequest := MessageID
44 if ( ber_scanf( op->o_ber, "i", &id ) == LBER_ERROR ) {
45 Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0 ,0 );
49 Debug( LDAP_DEBUG_ARGS, "do_abandon: id %d\n", id, 0 ,0 );
52 * find the operation being abandoned and set the o_abandon
53 * flag. It's up to the backend to periodically check this
54 * flag and abort the operation at a convenient time.
57 pthread_mutex_lock( &conn->c_opsmutex );
58 for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
59 if ( o->o_msgid == id )
64 pthread_mutex_lock( &o->o_abandonmutex );
66 pthread_mutex_unlock( &o->o_abandonmutex );
68 Debug( LDAP_DEBUG_TRACE, "do_abandon: op not found\n", 0, 0,
71 pthread_mutex_unlock( &conn->c_opsmutex );