aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-10-14 14:15:12 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-10-14 14:15:12 +0000
commit1b03c4df12ae33861b28af20979e530ecb914fed (patch)
tree7b41b3eaed5b1a851db5b4e9d4c80eed40041f5d /src
parent692f77eb5db9f2be29079deb2cffa5925682acc8 (diff)
downloadgnunet-1b03c4df12ae33861b28af20979e530ecb914fed.tar.gz
gnunet-1b03c4df12ae33861b28af20979e530ecb914fed.zip
no merging just replacing
Diffstat (limited to 'src')
-rw-r--r--src/ats/gnunet-service-ats_addresses.c40
-rw-r--r--src/ats/test_ats_api.conf2
2 files changed, 8 insertions, 34 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index e874ca7c4..5ed3c471b 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -111,37 +111,6 @@ find_address (const struct GNUNET_PeerIdentity *peer,
111 return cac.result; 111 return cac.result;
112} 112}
113 113
114static void
115merge_ats (struct ATS_Address * dest, struct ATS_Address * source)
116{
117 /*
118 int c_src = 0;
119 int c_dest = 0;
120 struct GNUNET_TRANSPORT_ATS_Information * a_src = source->ats;
121 struct GNUNET_TRANSPORT_ATS_Information * a_dest = dest->ats;
122 struct ATS_Address * bigger = NULL;
123
124 bigger = (dest->ats_count > source->ats_count) ? dest : source;
125 int new_entries = bigger->ats_count;
126
127 if (new_entries == 0)
128 return;
129
130 for (c_dest = 0; c_dest < dest->ats_count; c_dest ++)
131 {
132 for (c_src = 0; c_src < source->ats_count; c_src ++)
133 {
134 if (a_src[c_src].type == a_dest[c_dest].type)
135 new_entries--;
136 }
137 }
138
139 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
140 "Have %u entries to update and %u new entries\n",bigger->ats_count,
141 new_entries);
142 */
143}
144
145void 114void
146GAS_address_update (const struct GNUNET_PeerIdentity *peer, 115GAS_address_update (const struct GNUNET_PeerIdentity *peer,
147 const char *plugin_name, 116 const char *plugin_name,
@@ -181,11 +150,16 @@ GAS_address_update (const struct GNUNET_PeerIdentity *peer,
181 } 150 }
182 else 151 else
183 { 152 {
184 merge_ats (old, aa);
185 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 153 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
186 "Updated existing address for peer `%s' %X \n", 154 "Updated existing address for peer `%s' %X \n",
187 GNUNET_i2s (peer), old); 155 GNUNET_i2s (peer), old);
188 destroy_address (aa); 156 GNUNET_free_non_null(old->ats);
157 old->ats = NULL;
158 old->ats_count = 0;
159 old->ats = aa->ats;
160 old->ats_count = aa->ats_count;
161 GNUNET_free (aa->plugin);
162 GNUNET_free (aa);
189 } 163 }
190 164
191} 165}
diff --git a/src/ats/test_ats_api.conf b/src/ats/test_ats_api.conf
index de539981b..79e92af49 100644
--- a/src/ats/test_ats_api.conf
+++ b/src/ats/test_ats_api.conf
@@ -8,7 +8,7 @@ UNIXPATH = /tmp/test-ats-scheduling-arm.sock
8 8
9[ats] 9[ats]
10DEBUG = YES 10DEBUG = YES
11PREFIX = valgrind --leak-check=full 11#PREFIX = valgrind --leak-check=full
12AUTOSTART = YES 12AUTOSTART = YES
13PORT = 12002 13PORT = 12002
14HOSTNAME = localhost 14HOSTNAME = localhost