diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-27 10:32:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-27 10:32:30 +0000 |
commit | 817bbb71e3e583ec85d6d63ca3e0cbb90ccd7462 (patch) | |
tree | 7e9e8717e9f57b74fca3a0e93f0d4b94234a1dd3 /src/fs | |
parent | 3814b7980a4ed1117be9659a3d10fa49cb4c16e9 (diff) | |
download | gnunet-817bbb71e3e583ec85d6d63ca3e0cbb90ccd7462.tar.gz gnunet-817bbb71e3e583ec85d6d63ca3e0cbb90ccd7462.zip |
communicate res delay in capi
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 9 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 687f131d1..74a88e7b2 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -2658,6 +2658,8 @@ refresh_bloomfilter (struct PendingRequest *pr) | |||
2658 | * @param peer identifies the peer | 2658 | * @param peer identifies the peer |
2659 | * @param bpm_out set to the current bandwidth limit (sending) for this peer | 2659 | * @param bpm_out set to the current bandwidth limit (sending) for this peer |
2660 | * @param amount set to the amount that was actually reserved or unreserved | 2660 | * @param amount set to the amount that was actually reserved or unreserved |
2661 | * @param res_delay if the reservation could not be satisfied (amount was 0), how | ||
2662 | * long should the client wait until re-trying? | ||
2661 | * @param preference current traffic preference for the given peer | 2663 | * @param preference current traffic preference for the given peer |
2662 | */ | 2664 | */ |
2663 | static void | 2665 | static void |
@@ -2665,7 +2667,8 @@ target_reservation_cb (void *cls, | |||
2665 | const struct | 2667 | const struct |
2666 | GNUNET_PeerIdentity * peer, | 2668 | GNUNET_PeerIdentity * peer, |
2667 | struct GNUNET_BANDWIDTH_Value32NBO bpm_out, | 2669 | struct GNUNET_BANDWIDTH_Value32NBO bpm_out, |
2668 | int amount, | 2670 | int32_t amount, |
2671 | struct GNUNET_TIME_Relative res_delay, | ||
2669 | uint64_t preference) | 2672 | uint64_t preference) |
2670 | { | 2673 | { |
2671 | struct PendingRequest *pr = cls; | 2674 | struct PendingRequest *pr = cls; |
@@ -3175,7 +3178,9 @@ forward_request_task (void *cls, | |||
3175 | /* force forwarding */ | 3178 | /* force forwarding */ |
3176 | static struct GNUNET_BANDWIDTH_Value32NBO zerobw; | 3179 | static struct GNUNET_BANDWIDTH_Value32NBO zerobw; |
3177 | target_reservation_cb (pr, &psc.target, | 3180 | target_reservation_cb (pr, &psc.target, |
3178 | zerobw, 0, 0.0); | 3181 | zerobw, 0, |
3182 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
3183 | 0.0); | ||
3179 | } | 3184 | } |
3180 | } | 3185 | } |
3181 | 3186 | ||
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 783bd4024..05638b657 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -330,13 +330,16 @@ peer_transmit_ready_cb (void *cls, | |||
330 | * @param bandwidth_out available amount of outbound bandwidth | 330 | * @param bandwidth_out available amount of outbound bandwidth |
331 | * @param amount set to the amount that was actually reserved or unreserved; | 331 | * @param amount set to the amount that was actually reserved or unreserved; |
332 | * either the full requested amount or zero (no partial reservations) | 332 | * either the full requested amount or zero (no partial reservations) |
333 | * @param res_delay if the reservation could not be satisfied (amount was 0), how | ||
334 | * long should the client wait until re-trying? | ||
333 | * @param preference current traffic preference for the given peer | 335 | * @param preference current traffic preference for the given peer |
334 | */ | 336 | */ |
335 | static void | 337 | static void |
336 | core_reserve_callback (void *cls, | 338 | core_reserve_callback (void *cls, |
337 | const struct GNUNET_PeerIdentity *peer, | 339 | const struct GNUNET_PeerIdentity *peer, |
338 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 340 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
339 | int amount, | 341 | int32_t amount, |
342 | struct GNUNET_TIME_Relative res_delay, | ||
340 | uint64_t preference) | 343 | uint64_t preference) |
341 | { | 344 | { |
342 | struct GSF_ConnectedPeer *cp = cls; | 345 | struct GSF_ConnectedPeer *cp = cls; |
@@ -347,6 +350,7 @@ core_reserve_callback (void *cls, | |||
347 | if (0 == amount) | 350 | if (0 == amount) |
348 | { | 351 | { |
349 | /* failed; retry! (how did we get here!?) */ | 352 | /* failed; retry! (how did we get here!?) */ |
353 | /* FIXME: wait res_delay before re-trying! */ | ||
350 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 354 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
351 | _("Failed to reserve bandwidth to peer `%s'\n"), | 355 | _("Failed to reserve bandwidth to peer `%s'\n"), |
352 | GNUNET_i2s (peer)); | 356 | GNUNET_i2s (peer)); |