diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-01 18:20:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-01 18:20:44 +0000 |
commit | 3a3219bcc1d219bf012d20bcc87c03041f59044d (patch) | |
tree | aff9063ede978dad957d19ecd84f7b09c3de4768 /src/datastore | |
parent | a8de20af8037dc7fc0bdad2ebe235942b91f4f28 (diff) | |
download | gnunet-3a3219bcc1d219bf012d20bcc87c03041f59044d.tar.gz gnunet-3a3219bcc1d219bf012d20bcc87c03041f59044d.zip |
-removing legacy #ifdefs
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/plugin_datastore_mysql.c | 12 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 15 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_sqlite.c | 27 |
3 files changed, 0 insertions, 54 deletions
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c index e2c77edd8..ed7741cfc 100644 --- a/src/datastore/plugin_datastore_mysql.c +++ b/src/datastore/plugin_datastore_mysql.c | |||
@@ -121,7 +121,6 @@ | |||
121 | #include "gnunet_util_lib.h" | 121 | #include "gnunet_util_lib.h" |
122 | #include "gnunet_mysql_lib.h" | 122 | #include "gnunet_mysql_lib.h" |
123 | 123 | ||
124 | #define DEBUG_MYSQL GNUNET_EXTRA_LOGGING | ||
125 | 124 | ||
126 | #define MAX_DATUM_SIZE 65536 | 125 | #define MAX_DATUM_SIZE 65536 |
127 | 126 | ||
@@ -227,10 +226,8 @@ do_delete_entry (struct Plugin *plugin, unsigned long long uid) | |||
227 | { | 226 | { |
228 | int ret; | 227 | int ret; |
229 | 228 | ||
230 | #if DEBUG_MYSQL | ||
231 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting value %llu from gn090 table\n", | 229 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting value %llu from gn090 table\n", |
232 | uid); | 230 | uid); |
233 | #endif | ||
234 | ret = GNUNET_MYSQL_statement_run_prepared (plugin->mc, | 231 | ret = GNUNET_MYSQL_statement_run_prepared (plugin->mc, |
235 | plugin->delete_entry_by_uid, NULL, | 232 | plugin->delete_entry_by_uid, NULL, |
236 | MYSQL_TYPE_LONGLONG, &uid, GNUNET_YES, -1); | 233 | MYSQL_TYPE_LONGLONG, &uid, GNUNET_YES, -1); |
@@ -323,11 +320,9 @@ mysql_plugin_put (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
323 | MYSQL_TYPE_BLOB, &vhash, hashSize2, &hashSize2, | 320 | MYSQL_TYPE_BLOB, &vhash, hashSize2, &hashSize2, |
324 | MYSQL_TYPE_BLOB, data, lsize, &lsize, -1)) | 321 | MYSQL_TYPE_BLOB, data, lsize, &lsize, -1)) |
325 | return GNUNET_SYSERR; | 322 | return GNUNET_SYSERR; |
326 | #if DEBUG_MYSQL | ||
327 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 323 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
328 | "Inserted value `%s' with size %u into gn090 table\n", | 324 | "Inserted value `%s' with size %u into gn090 table\n", |
329 | GNUNET_h2s (key), (unsigned int) size); | 325 | GNUNET_h2s (key), (unsigned int) size); |
330 | #endif | ||
331 | if (size > 0) | 326 | if (size > 0) |
332 | plugin->env->duc (plugin->env->cls, size); | 327 | plugin->env->duc (plugin->env->cls, size); |
333 | return GNUNET_OK; | 328 | return GNUNET_OK; |
@@ -366,11 +361,9 @@ mysql_plugin_update (void *cls, uint64_t uid, int delta, | |||
366 | unsigned long long lexpire = expire.abs_value; | 361 | unsigned long long lexpire = expire.abs_value; |
367 | int ret; | 362 | int ret; |
368 | 363 | ||
369 | #if DEBUG_MYSQL | ||
370 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 364 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
371 | "Updating value %llu adding %d to priority and maxing exp at %llu\n", | 365 | "Updating value %llu adding %d to priority and maxing exp at %llu\n", |
372 | vkey, delta, lexpire); | 366 | vkey, delta, lexpire); |
373 | #endif | ||
374 | ret = | 367 | ret = |
375 | GNUNET_MYSQL_statement_run_prepared (plugin->mc, plugin->update_entry, NULL, | 368 | GNUNET_MYSQL_statement_run_prepared (plugin->mc, plugin->update_entry, NULL, |
376 | MYSQL_TYPE_LONG, &delta, GNUNET_NO, | 369 | MYSQL_TYPE_LONG, &delta, GNUNET_NO, |
@@ -456,11 +449,9 @@ execute_select (struct Plugin *plugin, struct GNUNET_MYSQL_StatementHandle *stmt | |||
456 | proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0); | 449 | proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0); |
457 | return; | 450 | return; |
458 | } | 451 | } |
459 | #if DEBUG_MYSQL | ||
460 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 452 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
461 | "Found %u-byte value under key `%s' with prio %u, anon %u, expire %llu selecting from gn090 table\n", | 453 | "Found %u-byte value under key `%s' with prio %u, anon %u, expire %llu selecting from gn090 table\n", |
462 | (unsigned int) size, GNUNET_h2s (&key), priority, anonymity, exp); | 454 | (unsigned int) size, GNUNET_h2s (&key), priority, anonymity, exp); |
463 | #endif | ||
464 | GNUNET_assert (size < MAX_DATUM_SIZE); | 455 | GNUNET_assert (size < MAX_DATUM_SIZE); |
465 | expiration.abs_value = exp; | 456 | expiration.abs_value = exp; |
466 | ret = | 457 | ret = |
@@ -567,12 +558,9 @@ mysql_plugin_get_key (void *cls, uint64_t offset, const GNUNET_HashCode * key, | |||
567 | } | 558 | } |
568 | offset = offset % total; | 559 | offset = offset % total; |
569 | off = (unsigned long long) offset; | 560 | off = (unsigned long long) offset; |
570 | #if DEBUG_MYSQL | ||
571 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 561 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
572 | "Obtaining %llu/%lld result for GET `%s'\n", off, total, | 562 | "Obtaining %llu/%lld result for GET `%s'\n", off, total, |
573 | GNUNET_h2s (key)); | 563 | GNUNET_h2s (key)); |
574 | #endif | ||
575 | |||
576 | if (type != GNUNET_BLOCK_TYPE_ANY) | 564 | if (type != GNUNET_BLOCK_TYPE_ANY) |
577 | { | 565 | { |
578 | if (NULL != vhash) | 566 | if (NULL != vhash) |
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c index 5c7f75d5e..bbbbf9534 100644 --- a/src/datastore/plugin_datastore_postgres.c +++ b/src/datastore/plugin_datastore_postgres.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include "gnunet_postgres_lib.h" | 29 | #include "gnunet_postgres_lib.h" |
30 | #include <postgresql/libpq-fe.h> | 30 | #include <postgresql/libpq-fe.h> |
31 | 31 | ||
32 | #define DEBUG_POSTGRES GNUNET_EXTRA_LOGGING | ||
33 | 32 | ||
34 | /** | 33 | /** |
35 | * After how many ms "busy" should a DB operation fail for good? | 34 | * After how many ms "busy" should a DB operation fail for good? |
@@ -312,10 +311,8 @@ postgres_plugin_put (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
312 | return GNUNET_SYSERR; | 311 | return GNUNET_SYSERR; |
313 | PQclear (ret); | 312 | PQclear (ret); |
314 | plugin->env->duc (plugin->env->cls, size + GNUNET_DATASTORE_ENTRY_OVERHEAD); | 313 | plugin->env->duc (plugin->env->cls, size + GNUNET_DATASTORE_ENTRY_OVERHEAD); |
315 | #if DEBUG_POSTGRES | ||
316 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", | 314 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", |
317 | "Stored %u bytes in database\n", (unsigned int) size); | 315 | "Stored %u bytes in database\n", (unsigned int) size); |
318 | #endif | ||
319 | return GNUNET_OK; | 316 | return GNUNET_OK; |
320 | } | 317 | } |
321 | 318 | ||
@@ -349,10 +346,8 @@ process_result (struct Plugin *plugin, PluginDatumProcessor proc, | |||
349 | GNUNET_POSTGRES_check_result_ (plugin->dbh, res, PGRES_TUPLES_OK, "PQexecPrepared", "select", | 346 | GNUNET_POSTGRES_check_result_ (plugin->dbh, res, PGRES_TUPLES_OK, "PQexecPrepared", "select", |
350 | filename, line)) | 347 | filename, line)) |
351 | { | 348 | { |
352 | #if DEBUG_POSTGRES | ||
353 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", | 349 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", |
354 | "Ending iteration (postgres error)\n"); | 350 | "Ending iteration (postgres error)\n"); |
355 | #endif | ||
356 | proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0); | 351 | proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0); |
357 | return; | 352 | return; |
358 | } | 353 | } |
@@ -360,10 +355,8 @@ process_result (struct Plugin *plugin, PluginDatumProcessor proc, | |||
360 | if (0 == PQntuples (res)) | 355 | if (0 == PQntuples (res)) |
361 | { | 356 | { |
362 | /* no result */ | 357 | /* no result */ |
363 | #if DEBUG_POSTGRES | ||
364 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", | 358 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", |
365 | "Ending iteration (no more results)\n"); | 359 | "Ending iteration (no more results)\n"); |
366 | #endif | ||
367 | proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0); | 360 | proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0); |
368 | PQclear (res); | 361 | PQclear (res); |
369 | return; | 362 | return; |
@@ -398,11 +391,9 @@ process_result (struct Plugin *plugin, PluginDatumProcessor proc, | |||
398 | GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3)); | 391 | GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3)); |
399 | memcpy (&key, PQgetvalue (res, 0, 4), sizeof (GNUNET_HashCode)); | 392 | memcpy (&key, PQgetvalue (res, 0, 4), sizeof (GNUNET_HashCode)); |
400 | size = PQgetlength (res, 0, 5); | 393 | size = PQgetlength (res, 0, 5); |
401 | #if DEBUG_POSTGRES | ||
402 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", | 394 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", |
403 | "Found result of size %u bytes and type %u in database\n", | 395 | "Found result of size %u bytes and type %u in database\n", |
404 | (unsigned int) size, (unsigned int) type); | 396 | (unsigned int) size, (unsigned int) type); |
405 | #endif | ||
406 | iret = | 397 | iret = |
407 | proc (proc_cls, &key, size, PQgetvalue (res, 0, 5), | 398 | proc (proc_cls, &key, size, PQgetvalue (res, 0, 5), |
408 | (enum GNUNET_BLOCK_Type) type, priority, anonymity, expiration_time, | 399 | (enum GNUNET_BLOCK_Type) type, priority, anonymity, expiration_time, |
@@ -410,23 +401,17 @@ process_result (struct Plugin *plugin, PluginDatumProcessor proc, | |||
410 | PQclear (res); | 401 | PQclear (res); |
411 | if (iret == GNUNET_NO) | 402 | if (iret == GNUNET_NO) |
412 | { | 403 | { |
413 | #if DEBUG_POSTGRES | ||
414 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 404 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
415 | "Processor asked for item %u to be removed.\n", rowid); | 405 | "Processor asked for item %u to be removed.\n", rowid); |
416 | #endif | ||
417 | if (GNUNET_OK == GNUNET_POSTGRES_delete_by_rowid (plugin->dbh, "delrow", rowid)) | 406 | if (GNUNET_OK == GNUNET_POSTGRES_delete_by_rowid (plugin->dbh, "delrow", rowid)) |
418 | { | 407 | { |
419 | #if DEBUG_POSTGRES | ||
420 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", | 408 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", |
421 | "Deleting %u bytes from database\n", | 409 | "Deleting %u bytes from database\n", |
422 | (unsigned int) size); | 410 | (unsigned int) size); |
423 | #endif | ||
424 | plugin->env->duc (plugin->env->cls, | 411 | plugin->env->duc (plugin->env->cls, |
425 | -(size + GNUNET_DATASTORE_ENTRY_OVERHEAD)); | 412 | -(size + GNUNET_DATASTORE_ENTRY_OVERHEAD)); |
426 | #if DEBUG_POSTGRES | ||
427 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", | 413 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datastore-postgres", |
428 | "Deleted %u bytes from database\n", (unsigned int) size); | 414 | "Deleted %u bytes from database\n", (unsigned int) size); |
429 | #endif | ||
430 | } | 415 | } |
431 | } | 416 | } |
432 | } | 417 | } |
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index cd5ae394f..00195fb13 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -28,10 +28,6 @@ | |||
28 | #include "gnunet_datastore_plugin.h" | 28 | #include "gnunet_datastore_plugin.h" |
29 | #include <sqlite3.h> | 29 | #include <sqlite3.h> |
30 | 30 | ||
31 | /** | ||
32 | * Enable or disable logging debug messages. | ||
33 | */ | ||
34 | #define DEBUG_SQLITE GNUNET_EXTRA_LOGGING | ||
35 | 31 | ||
36 | /** | 32 | /** |
37 | * We allocate items on the stack at times. To prevent a stack | 33 | * We allocate items on the stack at times. To prevent a stack |
@@ -147,10 +143,8 @@ sq_prepare (sqlite3 * dbh, const char *zSql, sqlite3_stmt ** ppStmt) | |||
147 | result = | 143 | result = |
148 | sqlite3_prepare_v2 (dbh, zSql, strlen (zSql), ppStmt, | 144 | sqlite3_prepare_v2 (dbh, zSql, strlen (zSql), ppStmt, |
149 | (const char **) &dummy); | 145 | (const char **) &dummy); |
150 | #if DEBUG_SQLITE && 0 | ||
151 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 146 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
152 | "Prepared `%s' / %p: %d\n", zSql, *ppStmt, result); | 147 | "Prepared `%s' / %p: %d\n", zSql, *ppStmt, result); |
153 | #endif | ||
154 | return result; | 148 | return result; |
155 | } | 149 | } |
156 | 150 | ||
@@ -415,10 +409,8 @@ database_shutdown (struct Plugin *plugin) | |||
415 | stmt = sqlite3_next_stmt (plugin->dbh, NULL); | 409 | stmt = sqlite3_next_stmt (plugin->dbh, NULL); |
416 | while (stmt != NULL) | 410 | while (stmt != NULL) |
417 | { | 411 | { |
418 | #if DEBUG_SQLITE | ||
419 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 412 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
420 | "Closing statement %p\n", stmt); | 413 | "Closing statement %p\n", stmt); |
421 | #endif | ||
422 | result = sqlite3_finalize (stmt); | 414 | result = sqlite3_finalize (stmt); |
423 | if (result != SQLITE_OK) | 415 | if (result != SQLITE_OK) |
424 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "sqlite", | 416 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "sqlite", |
@@ -502,14 +494,12 @@ sqlite_plugin_put (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
502 | 494 | ||
503 | if (size > MAX_ITEM_SIZE) | 495 | if (size > MAX_ITEM_SIZE) |
504 | return GNUNET_SYSERR; | 496 | return GNUNET_SYSERR; |
505 | #if DEBUG_SQLITE | ||
506 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 497 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
507 | "Storing in database block with type %u/key `%s'/priority %u/expiration in %llu ms (%lld).\n", | 498 | "Storing in database block with type %u/key `%s'/priority %u/expiration in %llu ms (%lld).\n", |
508 | type, GNUNET_h2s (key), priority, | 499 | type, GNUNET_h2s (key), priority, |
509 | (unsigned long long) | 500 | (unsigned long long) |
510 | GNUNET_TIME_absolute_get_remaining (expiration).rel_value, | 501 | GNUNET_TIME_absolute_get_remaining (expiration).rel_value, |
511 | (long long) expiration.abs_value); | 502 | (long long) expiration.abs_value); |
512 | #endif | ||
513 | GNUNET_CRYPTO_hash (data, size, &vhash); | 503 | GNUNET_CRYPTO_hash (data, size, &vhash); |
514 | stmt = plugin->insertContent; | 504 | stmt = plugin->insertContent; |
515 | rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX); | 505 | rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX); |
@@ -540,11 +530,9 @@ sqlite_plugin_put (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
540 | { | 530 | { |
541 | case SQLITE_DONE: | 531 | case SQLITE_DONE: |
542 | plugin->env->duc (plugin->env->cls, size + GNUNET_DATASTORE_ENTRY_OVERHEAD); | 532 | plugin->env->duc (plugin->env->cls, size + GNUNET_DATASTORE_ENTRY_OVERHEAD); |
543 | #if DEBUG_SQLITE | ||
544 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 533 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
545 | "Stored new entry (%u bytes)\n", | 534 | "Stored new entry (%u bytes)\n", |
546 | size + GNUNET_DATASTORE_ENTRY_OVERHEAD); | 535 | size + GNUNET_DATASTORE_ENTRY_OVERHEAD); |
547 | #endif | ||
548 | ret = GNUNET_OK; | 536 | ret = GNUNET_OK; |
549 | break; | 537 | break; |
550 | case SQLITE_BUSY: | 538 | case SQLITE_BUSY: |
@@ -621,9 +609,7 @@ sqlite_plugin_update (void *cls, uint64_t uid, int delta, | |||
621 | switch (n) | 609 | switch (n) |
622 | { | 610 | { |
623 | case SQLITE_DONE: | 611 | case SQLITE_DONE: |
624 | #if DEBUG_SQLITE | ||
625 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Block updated\n"); | 612 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Block updated\n"); |
626 | #endif | ||
627 | return GNUNET_OK; | 613 | return GNUNET_OK; |
628 | case SQLITE_BUSY: | 614 | case SQLITE_BUSY: |
629 | LOG_SQLITE (plugin, msg, GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, | 615 | LOG_SQLITE (plugin, msg, GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, |
@@ -677,11 +663,9 @@ execute_get (struct Plugin *plugin, sqlite3_stmt * stmt, | |||
677 | break; | 663 | break; |
678 | } | 664 | } |
679 | expiration.abs_value = sqlite3_column_int64 (stmt, 3); | 665 | expiration.abs_value = sqlite3_column_int64 (stmt, 3); |
680 | #if DEBUG_SQLITE | ||
681 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 666 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
682 | "Found reply in database with expiration %llu\n", | 667 | "Found reply in database with expiration %llu\n", |
683 | (unsigned long long) expiration.abs_value); | 668 | (unsigned long long) expiration.abs_value); |
684 | #endif | ||
685 | ret = proc (proc_cls, sqlite3_column_blob (stmt, 4) /* key */ , | 669 | ret = proc (proc_cls, sqlite3_column_blob (stmt, 4) /* key */ , |
686 | size, sqlite3_column_blob (stmt, 5) /* data */ , | 670 | size, sqlite3_column_blob (stmt, 5) /* data */ , |
687 | sqlite3_column_int (stmt, 0) /* type */ , | 671 | sqlite3_column_int (stmt, 0) /* type */ , |
@@ -972,10 +956,8 @@ sqlite_plugin_get_replication (void *cls, PluginDatumProcessor proc, | |||
972 | uint32_t repl; | 956 | uint32_t repl; |
973 | sqlite3_stmt *stmt; | 957 | sqlite3_stmt *stmt; |
974 | 958 | ||
975 | #if DEBUG_SQLITE | ||
976 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 959 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
977 | "Getting random block based on replication order.\n"); | 960 | "Getting random block based on replication order.\n"); |
978 | #endif | ||
979 | rc.have_uid = GNUNET_NO; | 961 | rc.have_uid = GNUNET_NO; |
980 | rc.proc = proc; | 962 | rc.proc = proc; |
981 | rc.proc_cls = proc_cls; | 963 | rc.proc_cls = proc_cls; |
@@ -1061,10 +1043,8 @@ sqlite_plugin_get_expiration (void *cls, PluginDatumProcessor proc, | |||
1061 | sqlite3_stmt *stmt; | 1043 | sqlite3_stmt *stmt; |
1062 | struct GNUNET_TIME_Absolute now; | 1044 | struct GNUNET_TIME_Absolute now; |
1063 | 1045 | ||
1064 | #if DEBUG_SQLITE | ||
1065 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 1046 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
1066 | "Getting random block based on expiration and priority order.\n"); | 1047 | "Getting random block based on expiration and priority order.\n"); |
1067 | #endif | ||
1068 | now = GNUNET_TIME_absolute_get (); | 1048 | now = GNUNET_TIME_absolute_get (); |
1069 | stmt = plugin->selExpi; | 1049 | stmt = plugin->selExpi; |
1070 | if (SQLITE_OK != sqlite3_bind_int64 (stmt, 1, now.abs_value)) | 1050 | if (SQLITE_OK != sqlite3_bind_int64 (stmt, 1, now.abs_value)) |
@@ -1233,18 +1213,13 @@ libgnunet_plugin_datastore_sqlite_done (void *cls) | |||
1233 | struct GNUNET_DATASTORE_PluginFunctions *api = cls; | 1213 | struct GNUNET_DATASTORE_PluginFunctions *api = cls; |
1234 | struct Plugin *plugin = api->cls; | 1214 | struct Plugin *plugin = api->cls; |
1235 | 1215 | ||
1236 | #if DEBUG_SQLITE | ||
1237 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 1216 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
1238 | "sqlite plugin is done\n"); | 1217 | "sqlite plugin is done\n"); |
1239 | #endif | ||
1240 | |||
1241 | fn = NULL; | 1218 | fn = NULL; |
1242 | if (plugin->drop_on_shutdown) | 1219 | if (plugin->drop_on_shutdown) |
1243 | fn = GNUNET_strdup (plugin->fn); | 1220 | fn = GNUNET_strdup (plugin->fn); |
1244 | #if DEBUG_SQLITE | ||
1245 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 1221 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
1246 | "Shutting down database\n"); | 1222 | "Shutting down database\n"); |
1247 | #endif | ||
1248 | database_shutdown (plugin); | 1223 | database_shutdown (plugin); |
1249 | plugin->env = NULL; | 1224 | plugin->env = NULL; |
1250 | GNUNET_free (api); | 1225 | GNUNET_free (api); |
@@ -1254,10 +1229,8 @@ libgnunet_plugin_datastore_sqlite_done (void *cls) | |||
1254 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn); | 1229 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn); |
1255 | GNUNET_free (fn); | 1230 | GNUNET_free (fn); |
1256 | } | 1231 | } |
1257 | #if DEBUG_SQLITE | ||
1258 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", | 1232 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", |
1259 | "sqlite plugin is finished\n"); | 1233 | "sqlite plugin is finished\n"); |
1260 | #endif | ||
1261 | return NULL; | 1234 | return NULL; |
1262 | } | 1235 | } |
1263 | 1236 | ||