diff options
author | Nathan Kinder <nkinder@redhat.com> | 2008-01-25 00:59:00 +0000 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2008-01-25 00:59:00 +0000 |
commit | 0e365fd2ba59f54d46b94eb84a12d9c25b2bb560 (patch) | |
tree | dba8798de71257a635235ff8bc0a2e30d7dfe5e9 /ldap/servers/slapd/add.c | |
parent | 8ccabb1c7a14e377791c2d5be11540c8f54f4f89 (diff) | |
download | ds-0e365fd2ba59f54d46b94eb84a12d9c25b2bb560.tar.gz ds-0e365fd2ba59f54d46b94eb84a12d9c25b2bb560.tar.xz ds-0e365fd2ba59f54d46b94eb84a12d9c25b2bb560.zip |
Resolves: 429793
Summary: Fixed crash in replication during bulk import. Use bulk impport code more consistently.
Diffstat (limited to 'ldap/servers/slapd/add.c')
-rw-r--r-- | ldap/servers/slapd/add.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c index b500e34c..0e5c87cb 100644 --- a/ldap/servers/slapd/add.c +++ b/ldap/servers/slapd/add.c @@ -772,25 +772,19 @@ static void handle_fast_add(Slapi_PBlock *pb, Slapi_Entry *entry) slapi_pblock_set(pb, SLAPI_BULK_IMPORT_STATE, &ret); ret = (*be->be_wire_import)(pb); if (ret != 0) { - if (ret != LDAP_BUSY) { - LDAPDebug(LDAP_DEBUG_ANY, - "wire import: error during import (%d)\n", - ret, 0, 0); - } else { - LDAPDebug(LDAP_DEBUG_TRACE, - "wire import: asking client to wait before resuming (returning LDAP_BUSY)\n", - 0, 0, 0); - } - send_ldap_result(pb, - LDAP_BUSY == ret ? LDAP_BUSY : LDAP_OPERATIONS_ERROR, + LDAPDebug(LDAP_DEBUG_ANY, + "wire import: error during import (%d)\n", + ret, 0, 0); + send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL); + /* It's our responsibility to free the entry if + * be_wire_import doesn't succeed. */ slapi_entry_free(entry); - if (LDAP_BUSY != ret) { - /* turn off fast replica init -- import is now aborted */ - pb->pb_conn->c_bi_backend = NULL; - pb->pb_conn->c_flags &= ~CONN_FLAG_IMPORT; - } + /* turn off fast replica init -- import is now aborted */ + pb->pb_conn->c_bi_backend = NULL; + pb->pb_conn->c_flags &= ~CONN_FLAG_IMPORT; + return; } |