#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/*
* ldap_abandon - perform an ldap abandon operation. Parameters:
*
* ld LDAP descriptor
* msgid The message id of the operation to abandon
*
* ldap_abandon returns 0 if everything went ok, -1 otherwise.
*
* Example:
* ldap_abandon( ld, msgid );
*/
int
{
return( 0 );
}
return( -1 );
}
/*
* LDAPv3 extended abandon.
* Returns an LDAP error code.
*/
int
{
int rc;
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
/*
* XXXmcs should use cache function pointers to hook in memcache
*/
return( rc );
}
/*
* Abandon all outstanding requests for msgid (included child requests
* spawned when chasing referrals). This function calls itself recursively.
* No locking is done is this function so it must be done by the caller.
* Returns an LDAP error code and sets it in LDAP *ld as well
*/
static int
{
/*
* An abandon request looks like this:
* AbandonRequest ::= MessageID
*/
/* optimistic */
/*
* this is not the best implementation...
* the code special cases the when async io is enabled.
* The logic is clear this way, at the cost of code bloat.
* This logic should be cleaned up post nova 4.5 rtm
*/
{
/* Don't send an abandon message unless there is something to abandon. */
sendabandon = 0;
/* Find the request that we are abandoning. */
/* don't let caller abandon child requests! */
goto set_errorcode_and_return;
}
/* We only need to send an abandon message if the request
* is in progress.
*/
sendabandon = 1;
}
break;
}
/* we ignore errors from child abandons... */
}
}
}
}
else
{
sendabandon = 1;
/* find the request that we are abandoning */
break;
}
/* we ignore errors from child abandons... */
}
}
/* don't let caller abandon child requests! */
goto set_errorcode_and_return;
}
/* no need to send abandon message */
sendabandon = 0;
}
}
}
/* we had all the results and deleted them */
goto set_errorcode_and_return;
}
if ( sendabandon ) {
/* create a message to send */
LDAP_SUCCESS ) {
#ifdef CLDAP
} else {
#endif /* CLDAP */
#ifdef CLDAP
}
#endif /* CLDAP */
if ( bererr == -1 ||
} else {
/* send the message */
} else {
}
!= 0 ) {
}
}
}
}
if ( sendabandon ) {
0, 1 );
}
}
}
* sizeof(int) )) == NULL ) {
goto set_errorcode_and_return;
}
i = 0;
} else {
; /* NULL */
goto set_errorcode_and_return;
}
}
return( lderr );
}