aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-10-13 13:42:51 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-10-13 13:42:51 +0000
commit8c61ac28c875a62ed8f3a51bfbd7359fdd581d0b (patch)
tree92d5d8db78318cc46fdfa2c90861d0d4eaf069f5
parent04dd4108f7026aa5b09d0c971d13e7c08ed0a9fa (diff)
downloadgnunet-8c61ac28c875a62ed8f3a51bfbd7359fdd581d0b.tar.gz
gnunet-8c61ac28c875a62ed8f3a51bfbd7359fdd581d0b.zip
removign ats from neighbour
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 5c17648a8..51524556f 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -193,7 +193,7 @@ struct NeighbourMapEntry
193 /** 193 /**
194 * Performance data for the peer. 194 * Performance data for the peer.
195 */ 195 */
196 struct GNUNET_TRANSPORT_ATS_Information *ats; 196 //struct GNUNET_TRANSPORT_ATS_Information *ats;
197 197
198 /** 198 /**
199 * Are we currently trying to send a message? If so, which one? 199 * Are we currently trying to send a message? If so, which one?
@@ -257,7 +257,7 @@ struct NeighbourMapEntry
257 /** 257 /**
258 * Number of values in 'ats' array. 258 * Number of values in 'ats' array.
259 */ 259 */
260 unsigned int ats_count; 260 //unsigned int ats_count;
261 261
262 /** 262 /**
263 * Are we already in the process of disconnecting this neighbour? 263 * Are we already in the process of disconnecting this neighbour?
@@ -499,7 +499,6 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
499 GNUNET_SCHEDULER_cancel (n->transmission_task); 499 GNUNET_SCHEDULER_cancel (n->transmission_task);
500 n->transmission_task = GNUNET_SCHEDULER_NO_TASK; 500 n->transmission_task = GNUNET_SCHEDULER_NO_TASK;
501 } 501 }
502 GNUNET_array_grow (n->ats, n->ats_count, 0);
503 if (NULL != n->plugin_name) 502 if (NULL != n->plugin_name)
504 { 503 {
505 GNUNET_free (n->plugin_name); 504 GNUNET_free (n->plugin_name);
@@ -668,9 +667,6 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
668 memcpy (n->addr, address, address_len); 667 memcpy (n->addr, address, address_len);
669 n->addrlen = address_len; 668 n->addrlen = address_len;
670 n->session = session; 669 n->session = session;
671 GNUNET_array_grow (n->ats, n->ats_count, ats_count);
672 memcpy (n->ats, ats,
673 ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
674 GNUNET_free_non_null (n->plugin_name); 670 GNUNET_free_non_null (n->plugin_name);
675 n->plugin_name = GNUNET_strdup (plugin_name); 671 n->plugin_name = GNUNET_strdup (plugin_name);
676 GNUNET_SCHEDULER_cancel (n->timeout_task); 672 GNUNET_SCHEDULER_cancel (n->timeout_task);
@@ -694,7 +690,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
694 neighbours_connected++; 690 neighbours_connected++;
695 GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1, 691 GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1,
696 GNUNET_NO); 692 GNUNET_NO);
697 connect_notify_cb (callback_cls, peer, n->ats, n->ats_count); 693 connect_notify_cb (callback_cls, peer, ats, ats_count);
698} 694}
699 695
700/** 696/**
@@ -812,12 +808,6 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
812 GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_DISCONNECT_SESSION_TIMEOUT, 808 GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_DISCONNECT_SESSION_TIMEOUT,
813 &neighbour_timeout_task, n); 809 &neighbour_timeout_task, n);
814 /* try QUICKLY to re-establish a connection, reduce timeout! */ 810 /* try QUICKLY to re-establish a connection, reduce timeout! */
815 if (NULL != n->ats)
816 {
817 /* how can this be!? */
818 //GNUNET_break (0);
819 return;
820 }
821 GNUNET_ATS_suggest_address (GST_ats, peer); 811 GNUNET_ATS_suggest_address (GST_ats, peer);
822} 812}
823 813
@@ -1079,8 +1069,7 @@ neighbours_iterate (void *cls, const GNUNET_HashCode * key, void *value)
1079 if (GNUNET_YES != n->is_connected) 1069 if (GNUNET_YES != n->is_connected)
1080 return GNUNET_OK; 1070 return GNUNET_OK;
1081 1071
1082 GNUNET_assert (n->ats_count > 0); 1072 ic->cb (ic->cb_cls, &n->id, NULL, 0, n->plugin_name, n->addr, n->addrlen);
1083 ic->cb (ic->cb_cls, &n->id, n->ats, n->ats_count, n->plugin_name, n->addr, n->addrlen);
1084 return GNUNET_OK; 1073 return GNUNET_OK;
1085} 1074}
1086 1075