summaryrefslogtreecommitdiff
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)
-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)
n->id = *peer;
n->ack_state = ACK_UNDEFINED;
n->last_util_transmission = GNUNET_TIME_absolute_get();
+ n->neighbour_receive_quota = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
GNUNET_BANDWIDTH_tracker_init (&n->in_tracker,
&inbound_bw_tracker_update,
n,
@@ -3661,7 +3662,9 @@ GST_neighbours_handle_quota_message (const struct GNUNET_PeerIdentity *peer,
/* gone already */
return;
}
- n->neighbour_receive_quota = GNUNET_BANDWIDTH_value_init (ntohl (sqm->quota));
+ n->neighbour_receive_quota
+ = GNUNET_BANDWIDTH_value_max (GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
+ GNUNET_BANDWIDTH_value_init (ntohl (sqm->quota)));
bandwidth_min = GNUNET_BANDWIDTH_value_min (n->primary_address.bandwidth_out,
n->neighbour_receive_quota);