diff options
Diffstat (limited to 'src/testbed/gnunet-daemon-latency-logger.c')
-rw-r--r-- | src/testbed/gnunet-daemon-latency-logger.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/testbed/gnunet-daemon-latency-logger.c b/src/testbed/gnunet-daemon-latency-logger.c index a8951c3dd..2dca73768 100644 --- a/src/testbed/gnunet-daemon-latency-logger.c +++ b/src/testbed/gnunet-daemon-latency-logger.c | |||
@@ -68,7 +68,8 @@ struct Entry | |||
68 | struct GNUNET_PeerIdentity id; | 68 | struct GNUNET_PeerIdentity id; |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * The last known value for latency | 71 | * The last known value for latency. |
72 | * FIXME: type! | ||
72 | */ | 73 | */ |
73 | unsigned int latency; | 74 | unsigned int latency; |
74 | 75 | ||
@@ -166,8 +167,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
166 | * #GNUNET_SYSERR if this address is no longer available for ATS | 167 | * #GNUNET_SYSERR if this address is no longer available for ATS |
167 | * @param bandwidth_out assigned outbound bandwidth for the connection | 168 | * @param bandwidth_out assigned outbound bandwidth for the connection |
168 | * @param bandwidth_in assigned inbound bandwidth for the connection | 169 | * @param bandwidth_in assigned inbound bandwidth for the connection |
169 | * @param ats performance data for the address (as far as known) | 170 | * @param prop performance data for the address (as far as known) |
170 | * @param ats_count number of performance records in 'ats' | ||
171 | */ | 171 | */ |
172 | static void | 172 | static void |
173 | addr_info_cb (void *cls, | 173 | addr_info_cb (void *cls, |
@@ -175,8 +175,7 @@ addr_info_cb (void *cls, | |||
175 | int address_active, | 175 | int address_active, |
176 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 176 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
177 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 177 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
178 | const struct GNUNET_ATS_Information *ats, | 178 | const struct GNUNET_ATS_Properties *prop) |
179 | uint32_t ats_count) | ||
180 | { | 179 | { |
181 | static const char *query_insert = | 180 | static const char *query_insert = |
182 | "INSERT INTO ats_info(" | 181 | "INSERT INTO ats_info(" |
@@ -189,8 +188,7 @@ addr_info_cb (void *cls, | |||
189 | " datetime('now')" | 188 | " datetime('now')" |
190 | ");"; | 189 | ");"; |
191 | struct Entry *entry; | 190 | struct Entry *entry; |
192 | int latency; | 191 | int latency; /* FIXME: type!? */ |
193 | unsigned int cnt; | ||
194 | 192 | ||
195 | if (NULL == address) | 193 | if (NULL == address) |
196 | { | 194 | { |
@@ -201,15 +199,7 @@ addr_info_cb (void *cls, | |||
201 | GNUNET_assert (NULL != db); | 199 | GNUNET_assert (NULL != db); |
202 | if (GNUNET_YES != address_active) | 200 | if (GNUNET_YES != address_active) |
203 | return; | 201 | return; |
204 | for (cnt = 0; cnt < ats_count; cnt++) | 202 | latency = (int) prop->delay.rel_value_us; |
205 | { | ||
206 | if (GNUNET_ATS_QUALITY_NET_DELAY == ntohl (ats[cnt].type)) | ||
207 | goto insert; | ||
208 | } | ||
209 | return; | ||
210 | |||
211 | insert: | ||
212 | latency = (int) ntohl (ats[cnt].value); | ||
213 | entry = NULL; | 203 | entry = NULL; |
214 | if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains (map, | 204 | if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains (map, |
215 | &address->peer)) | 205 | &address->peer)) |