aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fs/gnunet-service-fs_push.c29
-rw-r--r--src/fs/test_gnunet_service_fs_migration_data.conf2
2 files changed, 27 insertions, 4 deletions
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index e720f392f..58588ebdb 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -226,6 +226,11 @@ transmit_message (void *cls,
226 GNUNET_assert (msize <= buf_size); 226 GNUNET_assert (msize <= buf_size);
227 memcpy (buf, msg, msize); 227 memcpy (buf, msg, msize);
228 GNUNET_free (msg); 228 GNUNET_free (msg);
229#if DEBUG_FS
230 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
231 "Pushing %u bytes to another peer\n",
232 msize);
233#endif
229 find_content (peer); 234 find_content (peer);
230 return msize; 235 return msize;
231} 236}
@@ -254,7 +259,7 @@ transmit_content (struct MigrationReadyPeer *peer,
254 msg = GNUNET_malloc (msize); 259 msg = GNUNET_malloc (msize);
255 msg->header.type = htons (42); 260 msg->header.type = htons (42);
256 msg->header.size = htons (msize); 261 msg->header.size = htons (msize);
257 262 GNUNET_break (0);
258 memcpy (&msg[1], 263 memcpy (&msg[1],
259 &block[1], 264 &block[1],
260 block->size); 265 block->size);
@@ -375,7 +380,17 @@ find_content (struct MigrationReadyPeer *mrp)
375 if (NULL == best) 380 if (NULL == best)
376 { 381 {
377 if (mig_size < MAX_MIGRATION_QUEUE) 382 if (mig_size < MAX_MIGRATION_QUEUE)
378 return; /* will fill up eventually... */ 383 {
384#if DEBUG_FS
385 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
386 "No content found for pushing, waiting for queue to fill\n");
387#endif
388 return; /* will fill up eventually... */
389 }
390#if DEBUG_FS
391 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
392 "No suitable content found, purging content from full queue\n");
393#endif
379 /* failed to find migration target AND 394 /* failed to find migration target AND
380 queue is full, purge most-forwarded 395 queue is full, purge most-forwarded
381 block from queue to make room for more */ 396 block from queue to make room for more */
@@ -392,10 +407,14 @@ find_content (struct MigrationReadyPeer *mrp)
392 pos = pos->next; 407 pos = pos->next;
393 } 408 }
394 GNUNET_assert (NULL != best); 409 GNUNET_assert (NULL != best);
395 delete_migration_block (best); 410 delete_migration_block (best);
396 consider_gathering (); 411 consider_gathering ();
397 return; 412 return;
398 } 413 }
414#if DEBUG_FS
415 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
416 "Preparing to push best content to peer\n");
417#endif
399 transmit_content (mrp, best); 418 transmit_content (mrp, best);
400} 419}
401 420
@@ -517,6 +536,10 @@ process_migration_content (void *cls,
517 { 536 {
518 if (NULL == pos->th) 537 if (NULL == pos->th)
519 { 538 {
539#if DEBUG_FS
540 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
541 "Preparing to push best content to peer\n");
542#endif
520 if (GNUNET_YES == transmit_content (pos, mb)) 543 if (GNUNET_YES == transmit_content (pos, mb))
521 break; /* 'mb' was freed! */ 544 break; /* 'mb' was freed! */
522 } 545 }
diff --git a/src/fs/test_gnunet_service_fs_migration_data.conf b/src/fs/test_gnunet_service_fs_migration_data.conf
index 3ab61d76c..a72a98e97 100644
--- a/src/fs/test_gnunet_service_fs_migration_data.conf
+++ b/src/fs/test_gnunet_service_fs_migration_data.conf
@@ -53,7 +53,7 @@ HOSTNAME = localhost
53ACTIVEMIGRATION = YES 53ACTIVEMIGRATION = YES
54CONTENT_CACHING = YES 54CONTENT_CACHING = YES
55CONTENT_PUSHING = YES 55CONTENT_PUSHING = YES
56#DEBUG = YES 56DEBUG = YES
57#PREFIX = valgrind --tool=memcheck --leak-check=yes 57#PREFIX = valgrind --tool=memcheck --leak-check=yes
58#PREFIX = xterm -e gdb -x cmd --args 58#PREFIX = xterm -e gdb -x cmd --args
59 59