summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap_tdb.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-29 11:46:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:20 -0500
commita116d7c7d9ddaf6bc6798ed98b3c62369e924076 (patch)
treefe07cc0c45fe35011069abab80ec06b0cdeefeaa /source3/lib/dbwrap_tdb.c
parenta0a32cf5d520937f492d32c743011741522f2d40 (diff)
downloadsamba-a116d7c7d9ddaf6bc6798ed98b3c62369e924076.tar.gz
samba-a116d7c7d9ddaf6bc6798ed98b3c62369e924076.tar.bz2
samba-a116d7c7d9ddaf6bc6798ed98b3c62369e924076.zip
r24773: Fix a ctdb connection lockup
The lockup could happen when packet_read_sync() gets two packets in a row, the first one being an async message, and the second one being the response to a ctdb request. Also add some debug msg to ctdb_conn.c, and cut off the "locking key" messages to only dump 20 hex chars at debug level 10. >10 will dump everything. (This used to be commit 0a55880a240b619810371a19144dd0a75208adfe)
Diffstat (limited to 'source3/lib/dbwrap_tdb.c')
-rw-r--r--source3/lib/dbwrap_tdb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/dbwrap_tdb.c b/source3/lib/dbwrap_tdb.c
index 5c958b8afd..be691dc7ec 100644
--- a/source3/lib/dbwrap_tdb.c
+++ b/source3/lib/dbwrap_tdb.c
@@ -31,7 +31,8 @@ static int db_tdb_record_destr(struct db_record* data)
struct db_tdb_ctx *ctx =
talloc_get_type_abort(data->private_data, struct db_tdb_ctx);
- DEBUG(10, ("Unlocking key %s\n",
+ DEBUG(10, (DEBUGLEVEL > 10
+ ? "Unlocking key %s\n" : "Unlocking key %20s\n",
hex_encode(data, (unsigned char *)data->key.dptr,
data->key.dsize)));
@@ -70,10 +71,12 @@ static struct db_record *db_tdb_fetch_locked(struct db_context *db,
result->store = db_tdb_store;
result->delete_rec = db_tdb_delete;
- {
+ if (DEBUGLEVEL > 10) {
char *keystr = hex_encode(NULL, (unsigned char *)key.dptr,
key.dsize);
- DEBUG(10, ("Locking key %s\n", keystr));
+ DEBUG(10, (DEBUGLEVEL > 10
+ ? "Locking key %s\n" : "Locking key %20s\n",
+ keystr));
TALLOC_FREE(keystr);
}