diff options
Diffstat (limited to 'src/dht/gnunet_dht_profiler.c')
-rw-r--r-- | src/dht/gnunet_dht_profiler.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c index bc6a08ebc..12fa7be4d 100644 --- a/src/dht/gnunet_dht_profiler.c +++ b/src/dht/gnunet_dht_profiler.c | |||
@@ -373,7 +373,6 @@ static int in_shutdown = 0; | |||
373 | static void | 373 | static void |
374 | collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 374 | collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
375 | 375 | ||
376 | |||
377 | /** | 376 | /** |
378 | * Shutdown task. Cleanup all resources and operations. | 377 | * Shutdown task. Cleanup all resources and operations. |
379 | * | 378 | * |
@@ -741,12 +740,24 @@ dht_connected (void *cls, | |||
741 | switch (mode) | 740 | switch (mode) |
742 | { | 741 | { |
743 | case MODE_PUT: | 742 | case MODE_PUT: |
743 | { | ||
744 | delay_put.rel_value_us = | ||
745 | delay_put.rel_value_us + | ||
746 | GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | ||
747 | delay_put.rel_value_us); | ||
744 | ac->delay_task = GNUNET_SCHEDULER_add_delayed (delay_put, &delayed_put, ac); | 748 | ac->delay_task = GNUNET_SCHEDULER_add_delayed (delay_put, &delayed_put, ac); |
745 | break; | 749 | break; |
750 | } | ||
746 | case MODE_GET: | 751 | case MODE_GET: |
752 | { | ||
753 | delay_get.rel_value_us = | ||
754 | delay_get.rel_value_us + | ||
755 | GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | ||
756 | delay_get.rel_value_us); | ||
747 | ac->delay_task = GNUNET_SCHEDULER_add_delayed (delay_get, &delayed_get, ac); | 757 | ac->delay_task = GNUNET_SCHEDULER_add_delayed (delay_get, &delayed_get, ac); |
748 | break; | 758 | break; |
749 | } | 759 | } |
760 | } | ||
750 | } | 761 | } |
751 | 762 | ||
752 | 763 | ||
@@ -1060,6 +1071,8 @@ set_malicious() | |||
1060 | } | 1071 | } |
1061 | } | 1072 | } |
1062 | #endif | 1073 | #endif |
1074 | |||
1075 | |||
1063 | /** | 1076 | /** |
1064 | * Callback called when DHT service on the peer is started | 1077 | * Callback called when DHT service on the peer is started |
1065 | * | 1078 | * |
@@ -1254,10 +1267,10 @@ main (int argc, char *const *argv) | |||
1254 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 1267 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
1255 | return 2; | 1268 | return 2; |
1256 | /* set default delays */ | 1269 | /* set default delays */ |
1257 | delay_stats = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); | 1270 | delay_stats = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1); |
1258 | delay_put = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1); | 1271 | delay_put = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1); |
1259 | delay_get = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1); | 1272 | delay_get = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1); |
1260 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 3); | 1273 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5); |
1261 | replication = 1; /* default replication */ | 1274 | replication = 1; /* default replication */ |
1262 | rc = 0; | 1275 | rc = 0; |
1263 | if (GNUNET_OK != | 1276 | if (GNUNET_OK != |