1
0

cb_abandon.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #include "cb.h"
  13. /*
  14. * Perform an abandon operation
  15. *
  16. * Returns:
  17. * 0 - success
  18. * <0 - fail
  19. *
  20. */
  21. int
  22. chaining_back_abandon ( Slapi_PBlock *pb )
  23. {
  24. /*
  25. * Abandon forwarded to the farm server for scoped
  26. * searches only. Done in cb_search.c
  27. */
  28. return 0;
  29. }
  30. int cb_check_forward_abandon(cb_backend_instance * cb,Slapi_PBlock * pb, LDAP * ld, int msgid ) {
  31. int rc;
  32. LDAPControl ** ctrls=NULL;
  33. if (slapi_op_abandoned( pb )) {
  34. if ((rc=cb_forward_operation(pb)) != LDAP_SUCCESS ) {
  35. return 0;
  36. }
  37. if ((rc = cb_update_controls( pb,ld,&ctrls,CB_UPDATE_CONTROLS_ISABANDON )) != LDAP_SUCCESS ) {
  38. if ( NULL != ctrls)
  39. ldap_controls_free(ctrls);
  40. return 0;
  41. }
  42. rc = ldap_abandon_ext(ld, msgid, ctrls, NULL );
  43. cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(rc));
  44. if ( NULL != ctrls)
  45. ldap_controls_free(ctrls);
  46. return 1;
  47. }
  48. return 0;
  49. }