aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-08 14:33:42 +0000
committerChristian Grothoff <christian@grothoff.org>2015-03-08 14:33:42 +0000
commit023cf4e2f6a6d50c40e6717fcc67bb598f0f54a9 (patch)
tree34a324c1ff70f23245863f30bca3212571cb2efb /src/transport/gnunet-service-transport_neighbours.c
parent247e63b4eb4db92cc0cfb2df9ca66632cc6c90b1 (diff)
downloadgnunet-023cf4e2f6a6d50c40e6717fcc67bb598f0f54a9.tar.gz
gnunet-023cf4e2f6a6d50c40e6717fcc67bb598f0f54a9.zip
-always assume at least MIN bandwidth, even if we got no quota or a quota lower than min
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 87dd9c213..a2aaa19ec 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -2140,6 +2140,7 @@ setup_neighbour (const struct GNUNET_PeerIdentity *peer)
2140 n->id = *peer; 2140 n->id = *peer;
2141 n->ack_state = ACK_UNDEFINED; 2141 n->ack_state = ACK_UNDEFINED;
2142 n->last_util_transmission = GNUNET_TIME_absolute_get(); 2142 n->last_util_transmission = GNUNET_TIME_absolute_get();
2143 n->neighbour_receive_quota = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
2143 GNUNET_BANDWIDTH_tracker_init (&n->in_tracker, 2144 GNUNET_BANDWIDTH_tracker_init (&n->in_tracker,
2144 &inbound_bw_tracker_update, 2145 &inbound_bw_tracker_update,
2145 n, 2146 n,
@@ -3661,7 +3662,9 @@ GST_neighbours_handle_quota_message (const struct GNUNET_PeerIdentity *peer,
3661 /* gone already */ 3662 /* gone already */
3662 return; 3663 return;
3663 } 3664 }
3664 n->neighbour_receive_quota = GNUNET_BANDWIDTH_value_init (ntohl (sqm->quota)); 3665 n->neighbour_receive_quota
3666 = GNUNET_BANDWIDTH_value_max (GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
3667 GNUNET_BANDWIDTH_value_init (ntohl (sqm->quota)));
3665 3668
3666 bandwidth_min = GNUNET_BANDWIDTH_value_min (n->primary_address.bandwidth_out, 3669 bandwidth_min = GNUNET_BANDWIDTH_value_min (n->primary_address.bandwidth_out,
3667 n->neighbour_receive_quota); 3670 n->neighbour_receive_quota);