diff options
Diffstat (limited to 'src/datastore/plugin_datastore_postgres.c')
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 15 |
1 files changed, 0 insertions, 15 deletions
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 | } |