diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-30 11:31:22 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-30 11:31:22 +0200 |
commit | ccf723196e9ff7f31a56a8e8ebd8319d07fa17c8 (patch) | |
tree | 0ccec2bc54f5f80f35054dda5a1cfe8202ab522f /src/exit | |
parent | 82c1ee4d147f28e919d82f87fcd787e719d7e572 (diff) | |
download | gnunet-ccf723196e9ff7f31a56a8e8ebd8319d07fa17c8.tar.gz gnunet-ccf723196e9ff7f31a56a8e8ebd8319d07fa17c8.zip |
eliminate DHT PUT OK message by using MQ feature of calling continuation when transmission is complete
Diffstat (limited to 'src/exit')
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 5cb1ebfd9..ae40feea0 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -3426,16 +3426,11 @@ do_dht_put (void *cls); | |||
3426 | * Schedules the next PUT. | 3426 | * Schedules the next PUT. |
3427 | * | 3427 | * |
3428 | * @param cls closure, NULL | 3428 | * @param cls closure, NULL |
3429 | * @param success #GNUNET_OK if the operation worked (unused) | ||
3430 | */ | 3429 | */ |
3431 | static void | 3430 | static void |
3432 | dht_put_cont (void *cls, | 3431 | dht_put_cont (void *cls) |
3433 | int success) | ||
3434 | { | 3432 | { |
3435 | dht_put = NULL; | 3433 | dht_put = NULL; |
3436 | dht_task = GNUNET_SCHEDULER_add_delayed (DHT_PUT_FREQUENCY, | ||
3437 | &do_dht_put, | ||
3438 | NULL); | ||
3439 | } | 3434 | } |
3440 | 3435 | ||
3441 | 3436 | ||
@@ -3450,7 +3445,9 @@ do_dht_put (void *cls) | |||
3450 | { | 3445 | { |
3451 | struct GNUNET_TIME_Absolute expiration; | 3446 | struct GNUNET_TIME_Absolute expiration; |
3452 | 3447 | ||
3453 | dht_task = NULL; | 3448 | dht_task = GNUNET_SCHEDULER_add_delayed (DHT_PUT_FREQUENCY, |
3449 | &do_dht_put, | ||
3450 | NULL); | ||
3454 | expiration = GNUNET_TIME_absolute_ntoh (dns_advertisement.expiration_time); | 3451 | expiration = GNUNET_TIME_absolute_ntoh (dns_advertisement.expiration_time); |
3455 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us < | 3452 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us < |
3456 | GNUNET_TIME_UNIT_HOURS.rel_value_us) | 3453 | GNUNET_TIME_UNIT_HOURS.rel_value_us) |
@@ -3463,6 +3460,8 @@ do_dht_put (void *cls) | |||
3463 | &dns_advertisement.purpose, | 3460 | &dns_advertisement.purpose, |
3464 | &dns_advertisement.signature)); | 3461 | &dns_advertisement.signature)); |
3465 | } | 3462 | } |
3463 | if (NULL != dht_put) | ||
3464 | GNUNET_DHT_put_cancel (dht_put); | ||
3466 | dht_put = GNUNET_DHT_put (dht, | 3465 | dht_put = GNUNET_DHT_put (dht, |
3467 | &dht_put_key, | 3466 | &dht_put_key, |
3468 | 1 /* replication */, | 3467 | 1 /* replication */, |