cb_abandon.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright 2001 Sun Microsystems, Inc.
  3. * Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. #include "cb.h"
  7. /*
  8. * Perform an abandon operation
  9. *
  10. * Returns:
  11. * 0 - success
  12. * <0 - fail
  13. *
  14. */
  15. int
  16. chaining_back_abandon ( Slapi_PBlock *pb )
  17. {
  18. /*
  19. * Abandon forwarded to the farm server for scoped
  20. * searches only. Done in cb_search.c
  21. */
  22. return 0;
  23. }
  24. int cb_check_forward_abandon(cb_backend_instance * cb,Slapi_PBlock * pb, LDAP * ld, int msgid ) {
  25. int rc;
  26. LDAPControl ** ctrls=NULL;
  27. if (slapi_op_abandoned( pb )) {
  28. if ((rc=cb_forward_operation(pb)) != LDAP_SUCCESS ) {
  29. return 0;
  30. }
  31. if ((rc = cb_update_controls( pb,ld,&ctrls,CB_UPDATE_CONTROLS_ISABANDON )) != LDAP_SUCCESS ) {
  32. if ( NULL != ctrls)
  33. ldap_controls_free(ctrls);
  34. return 0;
  35. }
  36. rc = ldap_abandon_ext(ld, msgid, ctrls, NULL );
  37. cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(rc));
  38. if ( NULL != ctrls)
  39. ldap_controls_free(ctrls);
  40. return 1;
  41. }
  42. return 0;
  43. }