aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index b82bd8694..58cb0fbb3 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -1689,6 +1689,15 @@ send_session_connect_ack_message (const struct GNUNET_HELLO_Address *address,
1689 1689
1690} 1690}
1691 1691
1692static void
1693inbound_bw_tracker_update (void *cls)
1694{
1695 struct Neighbour *n = cls;
1696
1697 /* Quota was updated, tell plugins to update the time to receive next */
1698
1699}
1700
1692 1701
1693/** 1702/**
1694 * Create a fresh entry in the neighbour map for the given peer 1703 * Create a fresh entry in the neighbour map for the given peer
@@ -1712,7 +1721,7 @@ setup_neighbour (const struct GNUNET_PeerIdentity *peer)
1712 n->util_payload_bytes_sent = 0; 1721 n->util_payload_bytes_sent = 0;
1713 n->util_total_bytes_recv = 0; 1722 n->util_total_bytes_recv = 0;
1714 n->util_total_bytes_sent = 0; 1723 n->util_total_bytes_sent = 0;
1715 GNUNET_BANDWIDTH_tracker_init (&n->in_tracker, 1724 GNUNET_BANDWIDTH_tracker_init (&n->in_tracker, &inbound_bw_tracker_update, n,
1716 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, 1725 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
1717 MAX_BANDWIDTH_CARRY_S); 1726 MAX_BANDWIDTH_CARRY_S);
1718 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 1727 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
@@ -2535,6 +2544,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2535 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 2544 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
2536{ 2545{
2537 struct NeighbourMapEntry *n; 2546 struct NeighbourMapEntry *n;
2547 struct GST_BlacklistCheck *blc;
2538 struct GNUNET_TRANSPORT_PluginFunctions *papi; 2548 struct GNUNET_TRANSPORT_PluginFunctions *papi;
2539 struct BlacklistCheckSwitchContext *blc_ctx; 2549 struct BlacklistCheckSwitchContext *blc_ctx;
2540 int c; 2550 int c;
@@ -2601,8 +2611,11 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2601 } 2611 }
2602 2612
2603 GNUNET_CONTAINER_DLL_insert (pending_bc_head, pending_bc_tail, blc_ctx); 2613 GNUNET_CONTAINER_DLL_insert (pending_bc_head, pending_bc_tail, blc_ctx);
2604 blc_ctx->blc = GST_blacklist_test_allowed (peer, address->transport_name, 2614 if (NULL != (blc = GST_blacklist_test_allowed (peer, address->transport_name,
2605 &switch_address_bl_check_cont, blc_ctx); 2615 &switch_address_bl_check_cont, blc_ctx)))
2616 {
2617 blc_ctx->blc = blc;
2618 }
2606} 2619}
2607 2620
2608 2621
@@ -3338,7 +3351,6 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target)
3338 return test_connected (lookup_neighbour (target)); 3351 return test_connected (lookup_neighbour (target));
3339} 3352}
3340 3353
3341
3342/** 3354/**
3343 * Change the incoming quota for the given peer. 3355 * Change the incoming quota for the given peer.
3344 * 3356 *