Skip to content
Snippets Groups Projects
Commit f106722e authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

working modrdn...

(need to fix leaks on transaction retries)
parent d4dee7c4
Branches
Tags
No related merge requests found
......@@ -17,8 +17,7 @@ bdb_dn2id_add(
BackendDB *be,
DB_TXN *txn,
const char *dn,
ID id
)
ID id )
{
int rc;
DBT key, data;
......@@ -212,8 +211,13 @@ bdb_dn2id(
/* fetch it */
rc = db->get( db, txn, &key, &data, 0 );
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: id=0x%08lx: %s (%d)\n",
*id, db_strerror( rc ), rc );
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: get failed: %s (%d)\n",
db_strerror( rc ), rc, 0 );
} else {
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: got id=0x%08lx\n",
*id, 0, 0 );
}
ch_free( key.data );
return rc;
......
......@@ -300,16 +300,18 @@ retry: rc = txn_abort( ltid );
new_ndn, 0, 0 );
rc = bdb_dn2id ( be, ltid, new_ndn, &id );
if( rc != 0 ) {
switch( rc ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
default:
rc = LDAP_OTHER;
text = "internal error";
}
switch( rc ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
case DB_NOTFOUND:
break;
case 0:
rc = LDAP_ALREADY_EXISTS;
goto return_results;
default:
rc = LDAP_OTHER;
text = "internal error";
goto return_results;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment