diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-10 11:20:59 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-10 11:20:59 +0000 |
commit | e9ef08a326a39c5702602f7b22f7fd23d5d6005d (patch) | |
tree | c6a0fb4608ffdcee0b5435c15c33902960839ed5 /src/transport | |
parent | 67de6d7d42841e482c64a875986713c58206c42e (diff) | |
download | gnunet-e9ef08a326a39c5702602f7b22f7fd23d5d6005d.tar.gz gnunet-e9ef08a326a39c5702602f7b22f7fd23d5d6005d.zip |
modifiying transport service
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index e4d0057ae..e16a71249 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet-service-transport_neighbours.h" | 28 | #include "gnunet-service-transport_neighbours.h" |
29 | #include "gnunet-service-transport_plugins.h" | 29 | #include "gnunet-service-transport_plugins.h" |
30 | #include "gnunet-service-transport_validation.h" | 30 | #include "gnunet-service-transport_validation.h" |
31 | #include "gnunet-service-transport_clients.h" | ||
31 | #include "gnunet-service-transport.h" | 32 | #include "gnunet-service-transport.h" |
32 | #include "gnunet_peerinfo_service.h" | 33 | #include "gnunet_peerinfo_service.h" |
33 | #include "gnunet_constants.h" | 34 | #include "gnunet_constants.h" |
@@ -722,6 +723,7 @@ try_connect_using_address (void *cls, const struct GNUNET_PeerIdentity *target, | |||
722 | n->asc = NULL; | 723 | n->asc = NULL; |
723 | was_connected = n->is_connected; | 724 | was_connected = n->is_connected; |
724 | n->is_connected = GNUNET_YES; | 725 | n->is_connected = GNUNET_YES; |
726 | |||
725 | GST_neighbours_switch_to_address (target, plugin_name, plugin_address, | 727 | GST_neighbours_switch_to_address (target, plugin_name, plugin_address, |
726 | plugin_address_len, session, ats, | 728 | plugin_address_len, session, ats, |
727 | ats_count); | 729 | ats_count); |
@@ -729,6 +731,28 @@ try_connect_using_address (void *cls, const struct GNUNET_PeerIdentity *target, | |||
729 | return; | 731 | return; |
730 | n->keepalive_task = GNUNET_SCHEDULER_add_now (&neighbour_keepalive_task, | 732 | n->keepalive_task = GNUNET_SCHEDULER_add_now (&neighbour_keepalive_task, |
731 | n); | 733 | n); |
734 | |||
735 | /* ATS told us inbound quota for this peer */ | ||
736 | #if DEBUG_TRANSPORT | ||
737 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting inbound quota of %u for peer `%s' to \n", | ||
738 | ntohl (bandwidth_in), GNUNET_i2s (target)); | ||
739 | #endif | ||
740 | |||
741 | |||
742 | GST_neighbours_set_incoming_quota (&n->id, bandwidth_in); | ||
743 | /* ATS told us outbound quota for this peer, tell all clients */ | ||
744 | #if DEBUG_TRANSPORT | ||
745 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending outbound quota of %u Bps for peer `%s' to all clients\n", | ||
746 | ntohl (bandwidth_out), GNUNET_i2s (target)); | ||
747 | #endif | ||
748 | |||
749 | struct QuotaSetMessage msg; | ||
750 | msg.header.size = htons (sizeof (struct QuotaSetMessage)); | ||
751 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA); | ||
752 | msg.quota = bandwidth_out; | ||
753 | msg.peer = (*target); | ||
754 | GST_clients_broadcast ((struct GNUNET_MessageHeader *) &msg, GNUNET_NO); | ||
755 | |||
732 | neighbours_connected++; | 756 | neighbours_connected++; |
733 | GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1, | 757 | GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1, |
734 | GNUNET_NO); | 758 | GNUNET_NO); |