X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Fgnunet-service-fs_push.c;h=22a76f332d2c51696a0aaa0343b271da9cb6fbf2;hb=99c66999a525b2783982ffa7590c988529184482;hp=4fde823a1d168046812dcb41ba891734ddd65b66;hpb=0443654040fb277df95aae28a7b2a54a4f0a73bf;p=oweals%2Fgnunet.git diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index 4fde823a1..22a76f332 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c @@ -31,8 +31,6 @@ #include "gnunet-service-fs_push.h" -#define DEBUG_FS_MIGRATION GNUNET_EXTRA_LOGGING - /** * Maximum number of blocks we keep in memory for migration. */ @@ -227,10 +225,8 @@ transmit_message (void *cls, size_t buf_size, void *buf) peer->msg = NULL; if (buf == NULL) { -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to migrate content to another peer (disconnect)\n"); -#endif GNUNET_free (msg); return 0; } @@ -238,10 +234,8 @@ transmit_message (void *cls, size_t buf_size, void *buf) GNUNET_assert (msize <= buf_size); memcpy (buf, msg, msize); GNUNET_free (msg); -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Pushing %u bytes to another peer\n", msize); -#endif find_content (peer); return msize; } @@ -292,10 +286,8 @@ transmit_content (struct MigrationReadyPeer *peer, { ret = GNUNET_NO; } -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking for transmission of %u bytes for migration\n", msize); -#endif peer->th = GSF_peer_transmit_ (peer->peer, GNUNET_NO, 0 /* priority */ , GNUNET_TIME_UNIT_FOREVER_REL, msize, &transmit_message, peer); @@ -390,16 +382,12 @@ find_content (struct MigrationReadyPeer *mrp) { if (mig_size < MAX_MIGRATION_QUEUE) { -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No content found for pushing, waiting for queue to fill\n"); -#endif return; /* will fill up eventually... */ } -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No suitable content found, purging content from full queue\n"); -#endif /* failed to find migration target AND * queue is full, purge most-forwarded * block from queue to make room for more */ @@ -419,10 +407,8 @@ find_content (struct MigrationReadyPeer *mrp) consider_gathering (); return; } -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Preparing to push best content to peer\n"); -#endif transmit_content (mrp, best); } @@ -459,10 +445,8 @@ consider_gathering () delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, mig_size); delay = GNUNET_TIME_relative_divide (delay, MAX_MIGRATION_QUEUE); delay = GNUNET_TIME_relative_max (delay, min_migration_delay); -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Scheduling gathering task (queue size: %u)\n", mig_size); -#endif mig_task = GNUNET_SCHEDULER_add_delayed (delay, &gather_migration_blocks, NULL); } @@ -494,9 +478,7 @@ process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size, mig_qe = NULL; if (key == NULL) { -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No content found for migration...\n"); -#endif consider_gathering (); return; } @@ -516,11 +498,9 @@ process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size, consider_gathering (); return; } -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Retrieved block `%s' of type %u for migration (queue size: %u/%u)\n", GNUNET_h2s (key), type, mig_size + 1, MAX_MIGRATION_QUEUE); -#endif mb = GNUNET_malloc (sizeof (struct MigrationReadyBlock) + size); mb->query = *key; mb->expiration = expiration; @@ -534,10 +514,8 @@ process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size, { if (NULL == pos->th) { -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Preparing to push best content to peer\n"); -#endif if (GNUNET_YES == transmit_content (pos, mb)) break; /* 'mb' was freed! */ } @@ -563,11 +541,9 @@ gather_migration_blocks (void *cls, return; if (GSF_dsh != NULL) { -#if DEBUG_FS_MIGRATION GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking datastore for content for replication (queue size: %u)\n", mig_size); -#endif mig_qe = GNUNET_DATASTORE_get_for_replication (GSF_dsh, 0, UINT_MAX, GNUNET_TIME_UNIT_FOREVER_REL,