mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-26 01:29:59 -05:00
More error msgs
This commit is contained in:
parent
473e2c997f
commit
a3346f969f
2 changed files with 22 additions and 3 deletions
|
|
@ -530,8 +530,12 @@ int mdb_ad_read( struct mdb_info *mdb, MDB_txn *txn )
|
|||
AttributeDescription *ad;
|
||||
|
||||
rc = mdb_cursor_open( txn, mdb->mi_ad2id, &mc );
|
||||
if ( rc )
|
||||
if ( rc ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"mdb_ad_read: cursor_open failed %s(%d)\n",
|
||||
mdb_strerror(rc), rc, 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* our array is 1-based, an index of 0 means no data */
|
||||
i = mdb->mi_numads+1;
|
||||
|
|
@ -569,6 +573,9 @@ int mdb_ad_get( struct mdb_info *mdb, MDB_txn *txn, AttributeDescription *ad )
|
|||
MDB_val key;
|
||||
|
||||
rc = mdb_ad_read( mdb, txn );
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if ( mdb->mi_adxs[ad->ad_index] )
|
||||
return 0;
|
||||
|
||||
|
|
@ -581,6 +588,10 @@ int mdb_ad_get( struct mdb_info *mdb, MDB_txn *txn, AttributeDescription *ad )
|
|||
mdb->mi_adxs[ad->ad_index] = i;
|
||||
mdb->mi_ads[i] = ad;
|
||||
mdb->mi_numads++;
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"mdb_ad_get: mdb_put failed %s(%d)\n",
|
||||
mdb_strerror(rc), rc, 0);
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
|
|
|||
|
|
@ -42,12 +42,18 @@ static int mdb_id2entry_put(
|
|||
|
||||
rc = mdb_entry_encode( op, tid, e, &data );
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
return -1;
|
||||
return LDAP_OTHER;
|
||||
}
|
||||
|
||||
rc = mdb_put( tid, dbi, &key, &data, flag );
|
||||
|
||||
op->o_tmpfree( data.mv_data, op->o_tmpmemctx );
|
||||
if (rc) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"mdb_id2entry_put: mdb_put failed: %s(%d) \"%s\"\n",
|
||||
mdb_strerror(rc), rc,
|
||||
e->e_nname.bv_val );
|
||||
rc = LDAP_OTHER;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -482,6 +488,7 @@ static int mdb_entry_partsize(struct mdb_info *mdb, MDB_txn *txn, Entry *e,
|
|||
eh->bv.bv_len = len;
|
||||
eh->nattrs = nat;
|
||||
eh->nvals = nval;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Flatten an Entry into a buffer. The buffer is filled with just the
|
||||
|
|
@ -507,6 +514,7 @@ static int mdb_entry_encode(Operation *op, MDB_txn *txn, Entry *e, MDB_val *data
|
|||
; /* empty */
|
||||
|
||||
rc = mdb_entry_partsize( mdb, txn, e, &eh );
|
||||
if (rc) return rc;
|
||||
|
||||
data->mv_size = eh.bv.bv_len;
|
||||
data->mv_data = op->o_tmpalloc(data->mv_size, op->o_tmpmemctx);
|
||||
|
|
|
|||
Loading…
Reference in a new issue