mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-18 21:04:45 -05:00
Add diagnostics
This commit is contained in:
parent
922cd5f41e
commit
7b97ddabeb
1 changed files with 34 additions and 0 deletions
|
|
@ -122,10 +122,16 @@ bdb_idl_insert_key(
|
||||||
data.size = 2 * sizeof( ID );
|
data.size = 2 * sizeof( ID );
|
||||||
|
|
||||||
} else if ( rc != 0 ) {
|
} else if ( rc != 0 ) {
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_insert_key: get failed: %s (%d)\n",
|
||||||
|
db_strerror(rc), rc, 0 );
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
} else if ( data.size == 0 || data.size % sizeof( ID ) ) {
|
} else if ( data.size == 0 || data.size % sizeof( ID ) ) {
|
||||||
/* size not multiple of ID size */
|
/* size not multiple of ID size */
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n",
|
||||||
|
(long) sizeof( ID ), (long) data.size, 0 );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
} else if ( BDB_IS_ALLIDS(ids) ) {
|
} else if ( BDB_IS_ALLIDS(ids) ) {
|
||||||
|
|
@ -133,6 +139,9 @@ bdb_idl_insert_key(
|
||||||
|
|
||||||
} else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) {
|
} else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) {
|
||||||
/* size mismatch */
|
/* size mismatch */
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_insert_key: get size mismatch: expected %ld, got %ld\n",
|
||||||
|
(long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -146,6 +155,11 @@ bdb_idl_insert_key(
|
||||||
/* store the key */
|
/* store the key */
|
||||||
rc = db->put( db, tid, key, &data, 0 );
|
rc = db->put( db, tid, key, &data, 0 );
|
||||||
|
|
||||||
|
if( rc != 0 ) {
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_insert_key: get failed: %s (%d)\n",
|
||||||
|
db_strerror(rc), rc, 0 );
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,10 +185,16 @@ bdb_idl_delete_key(
|
||||||
rc = db->get( db, tid, key, &data, DB_RMW );
|
rc = db->get( db, tid, key, &data, DB_RMW );
|
||||||
|
|
||||||
if ( rc != 0 ) {
|
if ( rc != 0 ) {
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_delete_key: get failed: %s (%d)\n",
|
||||||
|
db_strerror(rc), rc, 0 );
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
} else if ( data.size == 0 || data.size % sizeof( ID ) ) {
|
} else if ( data.size == 0 || data.size % sizeof( ID ) ) {
|
||||||
/* size not multiple of ID size */
|
/* size not multiple of ID size */
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_delete_key: odd size: expected %ld multiple, got %ld\n",
|
||||||
|
(long) sizeof( ID ), (long) data.size, 0 );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
} else if ( BDB_IS_ALLIDS(ids) ) {
|
} else if ( BDB_IS_ALLIDS(ids) ) {
|
||||||
|
|
@ -182,6 +202,9 @@ bdb_idl_delete_key(
|
||||||
|
|
||||||
} else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) {
|
} else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) {
|
||||||
/* size mismatch */
|
/* size mismatch */
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_delete_key: get size mismatch: expected %ld, got %ld\n",
|
||||||
|
(long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -192,6 +215,11 @@ bdb_idl_delete_key(
|
||||||
if( BDB_IS_ALLIDS(ids) ) {
|
if( BDB_IS_ALLIDS(ids) ) {
|
||||||
/* delete the key */
|
/* delete the key */
|
||||||
rc = db->del( db, tid, key, 0 );
|
rc = db->del( db, tid, key, 0 );
|
||||||
|
if( rc != 0 ) {
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_delete_key: delete failed: %s (%d)\n",
|
||||||
|
db_strerror(rc), rc, 0 );
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,5 +229,11 @@ bdb_idl_delete_key(
|
||||||
/* store the key */
|
/* store the key */
|
||||||
rc = db->put( db, tid, key, &data, 0 );
|
rc = db->put( db, tid, key, &data, 0 );
|
||||||
|
|
||||||
|
if( rc != 0 ) {
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"=> bdb_idl_delete_key: put failed: %s (%d)\n",
|
||||||
|
db_strerror(rc), rc, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue