diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
commit | 5746309cb4be2073d550ad7a6885e918631dbc38 (patch) | |
tree | 89455bc4aadf977816b38df13f990372cd81d71a /src/fs/gnunet-service-fs_push.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/fs/gnunet-service-fs_push.c')
-rw-r--r-- | src/fs/gnunet-service-fs_push.c | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index 108fce5fc..6d8c05999 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c | |||
@@ -227,8 +227,8 @@ transmit_message (void *cls, size_t buf_size, void *buf) | |||
227 | memcpy (buf, msg, msize); | 227 | memcpy (buf, msg, msize); |
228 | GNUNET_free (msg); | 228 | GNUNET_free (msg); |
229 | #if DEBUG_FS_MIGRATION | 229 | #if DEBUG_FS_MIGRATION |
230 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 230 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Pushing %u bytes to another peer\n", |
231 | "Pushing %u bytes to another peer\n", msize); | 231 | msize); |
232 | #endif | 232 | #endif |
233 | find_content (peer); | 233 | find_content (peer); |
234 | return msize; | 234 | return msize; |
@@ -285,8 +285,8 @@ transmit_content (struct MigrationReadyPeer *peer, | |||
285 | "Asking for transmission of %u bytes for migration\n", msize); | 285 | "Asking for transmission of %u bytes for migration\n", msize); |
286 | #endif | 286 | #endif |
287 | peer->th = GSF_peer_transmit_ (peer->peer, GNUNET_NO, 0 /* priority */ , | 287 | peer->th = GSF_peer_transmit_ (peer->peer, GNUNET_NO, 0 /* priority */ , |
288 | GNUNET_TIME_UNIT_FOREVER_REL, | 288 | GNUNET_TIME_UNIT_FOREVER_REL, msize, |
289 | msize, &transmit_message, peer); | 289 | &transmit_message, peer); |
290 | return ret; | 290 | return ret; |
291 | } | 291 | } |
292 | 292 | ||
@@ -421,9 +421,9 @@ find_content (struct MigrationReadyPeer *mrp) | |||
421 | * @param cls unused | 421 | * @param cls unused |
422 | * @param tc scheduler context (also unused) | 422 | * @param tc scheduler context (also unused) |
423 | */ | 423 | */ |
424 | static void | 424 | static void gather_migration_blocks (void *cls, |
425 | gather_migration_blocks (void *cls, | 425 | const struct GNUNET_SCHEDULER_TaskContext |
426 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 426 | *tc); |
427 | 427 | ||
428 | 428 | ||
429 | /** | 429 | /** |
@@ -450,8 +450,8 @@ consider_gathering () | |||
450 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 450 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
451 | "Scheduling gathering task (queue size: %u)\n", mig_size); | 451 | "Scheduling gathering task (queue size: %u)\n", mig_size); |
452 | #endif | 452 | #endif |
453 | mig_task = GNUNET_SCHEDULER_add_delayed (delay, | 453 | mig_task = |
454 | &gather_migration_blocks, NULL); | 454 | GNUNET_SCHEDULER_add_delayed (delay, &gather_migration_blocks, NULL); |
455 | } | 455 | } |
456 | 456 | ||
457 | 457 | ||
@@ -470,13 +470,9 @@ consider_gathering () | |||
470 | * maybe 0 if no unique identifier is available | 470 | * maybe 0 if no unique identifier is available |
471 | */ | 471 | */ |
472 | static void | 472 | static void |
473 | process_migration_content (void *cls, | 473 | process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size, |
474 | const GNUNET_HashCode * key, | 474 | const void *data, enum GNUNET_BLOCK_Type type, |
475 | size_t size, | 475 | uint32_t priority, uint32_t anonymity, |
476 | const void *data, | ||
477 | enum GNUNET_BLOCK_Type type, | ||
478 | uint32_t priority, | ||
479 | uint32_t anonymity, | ||
480 | struct GNUNET_TIME_Absolute expiration, uint64_t uid) | 476 | struct GNUNET_TIME_Absolute expiration, uint64_t uid) |
481 | { | 477 | { |
482 | struct MigrationReadyBlock *mb; | 478 | struct MigrationReadyBlock *mb; |
@@ -501,9 +497,8 @@ process_migration_content (void *cls, | |||
501 | if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) | 497 | if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) |
502 | { | 498 | { |
503 | if (GNUNET_OK != | 499 | if (GNUNET_OK != |
504 | GNUNET_FS_handle_on_demand_block (key, size, data, | 500 | GNUNET_FS_handle_on_demand_block (key, size, data, type, priority, |
505 | type, priority, anonymity, | 501 | anonymity, expiration, uid, |
506 | expiration, uid, | ||
507 | &process_migration_content, NULL)) | 502 | &process_migration_content, NULL)) |
508 | consider_gathering (); | 503 | consider_gathering (); |
509 | return; | 504 | return; |
@@ -560,11 +555,10 @@ gather_migration_blocks (void *cls, | |||
560 | "Asking datastore for content for replication (queue size: %u)\n", | 555 | "Asking datastore for content for replication (queue size: %u)\n", |
561 | mig_size); | 556 | mig_size); |
562 | #endif | 557 | #endif |
563 | mig_qe = GNUNET_DATASTORE_get_for_replication (GSF_dsh, | 558 | mig_qe = |
564 | 0, UINT_MAX, | 559 | GNUNET_DATASTORE_get_for_replication (GSF_dsh, 0, UINT_MAX, |
565 | GNUNET_TIME_UNIT_FOREVER_REL, | 560 | GNUNET_TIME_UNIT_FOREVER_REL, |
566 | &process_migration_content, | 561 | &process_migration_content, NULL); |
567 | NULL); | ||
568 | if (NULL == mig_qe) | 562 | if (NULL == mig_qe) |
569 | consider_gathering (); | 563 | consider_gathering (); |
570 | } | 564 | } |
@@ -632,15 +626,13 @@ GSF_push_stop_ (struct GSF_ConnectedPeer *peer) | |||
632 | void | 626 | void |
633 | GSF_push_init_ () | 627 | GSF_push_init_ () |
634 | { | 628 | { |
635 | enabled = GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, | 629 | enabled = |
636 | "FS", "CONTENT_PUSHING"); | 630 | GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, "FS", "CONTENT_PUSHING"); |
637 | if (GNUNET_YES != enabled) | 631 | if (GNUNET_YES != enabled) |
638 | return; | 632 | return; |
639 | 633 | ||
640 | if (GNUNET_OK != | 634 | if (GNUNET_OK != |
641 | GNUNET_CONFIGURATION_get_value_time (GSF_cfg, | 635 | GNUNET_CONFIGURATION_get_value_time (GSF_cfg, "fs", "MIN_MIGRATION_DELAY", |
642 | "fs", | ||
643 | "MIN_MIGRATION_DELAY", | ||
644 | &min_migration_delay)) | 636 | &min_migration_delay)) |
645 | { | 637 | { |
646 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 638 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |