diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-26 14:40:32 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-26 14:40:32 +0000 |
commit | 8c3e21fd33bc1b6da22f59c98269ba40d6705898 (patch) | |
tree | c7948e89fff852779d6e6e5a5cbe61f6a95bfc9e /src/ats | |
parent | 99c80773f26377a369524344144c373993872f41 (diff) | |
download | gnunet-8c3e21fd33bc1b6da22f59c98269ba40d6705898.tar.gz gnunet-8c3e21fd33bc1b6da22f59c98269ba40d6705898.zip |
adding useful info messages
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/plugin_ats_proportional.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index 60ae7dfcb..69ff12d60 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c | |||
@@ -881,9 +881,13 @@ get_active_address_it (void *cls, | |||
881 | struct ATS_Address **dest = cls; | 881 | struct ATS_Address **dest = cls; |
882 | struct ATS_Address *aa = (struct ATS_Address *) value; | 882 | struct ATS_Address *aa = (struct ATS_Address *) value; |
883 | 883 | ||
884 | LOG (GNUNET_ERROR_TYPE_INFO, | ||
885 | "Checking address %p\n", aa); | ||
886 | |||
884 | if (GNUNET_YES == aa->active) | 887 | if (GNUNET_YES == aa->active) |
885 | { | 888 | { |
886 | 889 | LOG (GNUNET_ERROR_TYPE_INFO, | |
890 | "Address %p is active\n", aa); | ||
887 | if (NULL != (*dest)) | 891 | if (NULL != (*dest)) |
888 | { | 892 | { |
889 | /* should never happen */ | 893 | /* should never happen */ |
@@ -894,6 +898,7 @@ get_active_address_it (void *cls, | |||
894 | return GNUNET_NO; | 898 | return GNUNET_NO; |
895 | } | 899 | } |
896 | (*dest) = aa; | 900 | (*dest) = aa; |
901 | |||
897 | } | 902 | } |
898 | return GNUNET_OK; | 903 | return GNUNET_OK; |
899 | } | 904 | } |
@@ -1241,6 +1246,7 @@ update_active_address (struct GAS_PROPORTIONAL_Handle *s, | |||
1241 | net = asi->network; | 1246 | net = asi->network; |
1242 | asi->activated = GNUNET_TIME_UNIT_ZERO_ABS; | 1247 | asi->activated = GNUNET_TIME_UNIT_ZERO_ABS; |
1243 | current_address->active = GNUNET_NO; /* No active any longer */ | 1248 | current_address->active = GNUNET_NO; /* No active any longer */ |
1249 | GNUNET_break (0); | ||
1244 | current_address->assigned_bw_in = BANDWIDTH_ZERO; /* no bandwidth assigned */ | 1250 | current_address->assigned_bw_in = BANDWIDTH_ZERO; /* no bandwidth assigned */ |
1245 | current_address->assigned_bw_out = BANDWIDTH_ZERO; /* no bandwidth assigned */ | 1251 | current_address->assigned_bw_out = BANDWIDTH_ZERO; /* no bandwidth assigned */ |
1246 | 1252 | ||
@@ -1291,7 +1297,8 @@ update_active_address (struct GAS_PROPORTIONAL_Handle *s, | |||
1291 | asi->activated = GNUNET_TIME_absolute_get(); | 1297 | asi->activated = GNUNET_TIME_absolute_get(); |
1292 | best_address->active = GNUNET_YES; | 1298 | best_address->active = GNUNET_YES; |
1293 | address_increment (s, net, GNUNET_NO, GNUNET_YES); | 1299 | address_increment (s, net, GNUNET_NO, GNUNET_YES); |
1294 | 1300 | LOG (GNUNET_ERROR_TYPE_INFO, "Address %p for peer `%s' is now active\n", | |
1301 | best_address, GNUNET_i2s (peer)); | ||
1295 | /* Distribute bandwidth */ | 1302 | /* Distribute bandwidth */ |
1296 | distribute_bandwidth_in_network (s, net); | 1303 | distribute_bandwidth_in_network (s, net); |
1297 | return best_address; | 1304 | return best_address; |
@@ -1416,8 +1423,12 @@ GAS_proportional_stop_get_preferred_address (void *solver, | |||
1416 | struct Network *cur_net; | 1423 | struct Network *cur_net; |
1417 | 1424 | ||
1418 | if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains (s->requests, peer)) | 1425 | if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains (s->requests, peer)) |
1426 | { | ||
1419 | GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_remove (s->requests, | 1427 | GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_remove (s->requests, |
1420 | peer, NULL)); | 1428 | peer, NULL)); |
1429 | LOG (GNUNET_ERROR_TYPE_INFO, "Stop suggesting addresses for peer `%s'\n", | ||
1430 | GNUNET_i2s (peer)); | ||
1431 | } | ||
1421 | 1432 | ||
1422 | cur = get_active_address (s, s->addresses, peer); | 1433 | cur = get_active_address (s, s->addresses, peer); |
1423 | if (NULL != cur) | 1434 | if (NULL != cur) |
@@ -1514,6 +1525,7 @@ GAS_proportional_address_delete (void *solver, | |||
1514 | { | 1525 | { |
1515 | /* Address was active, remove from network and update quotas*/ | 1526 | /* Address was active, remove from network and update quotas*/ |
1516 | address->active = GNUNET_NO; | 1527 | address->active = GNUNET_NO; |
1528 | |||
1517 | address->assigned_bw_in = BANDWIDTH_ZERO; | 1529 | address->assigned_bw_in = BANDWIDTH_ZERO; |
1518 | address->assigned_bw_out = BANDWIDTH_ZERO; | 1530 | address->assigned_bw_out = BANDWIDTH_ZERO; |
1519 | asi->calculated_quota_in_NBO = htonl (0); | 1531 | asi->calculated_quota_in_NBO = htonl (0); |