aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-03-27 10:32:30 +0000
committerChristian Grothoff <christian@grothoff.org>2011-03-27 10:32:30 +0000
commit817bbb71e3e583ec85d6d63ca3e0cbb90ccd7462 (patch)
tree7e9e8717e9f57b74fca3a0e93f0d4b94234a1dd3 /src/fs
parent3814b7980a4ed1117be9659a3d10fa49cb4c16e9 (diff)
downloadgnunet-817bbb71e3e583ec85d6d63ca3e0cbb90ccd7462.tar.gz
gnunet-817bbb71e3e583ec85d6d63ca3e0cbb90ccd7462.zip
communicate res delay in capi
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-service-fs.c9
-rw-r--r--src/fs/gnunet-service-fs_cp.c6
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 */
2663static void 2665static 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 */
335static void 337static void
336core_reserve_callback (void *cls, 338core_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));