diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-10 23:24:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-10 23:24:01 +0000 |
commit | 1c323bd4cbb388a9e7515a1f733a3062bf093aee (patch) | |
tree | 7cc525d79149d44840b9f7a0040aaf3e69ecd665 /src/transport/test_transport_api_manipulation_recv_tcp.c | |
parent | aedaaed687db1ff20b447378f01ad7306921450c (diff) | |
download | gnunet-1c323bd4cbb388a9e7515a1f733a3062bf093aee.tar.gz gnunet-1c323bd4cbb388a9e7515a1f733a3062bf093aee.zip |
fixing #3657 (replace ATS_Information with struct), but WIHTOUT fixing ATS testcases yet
Diffstat (limited to 'src/transport/test_transport_api_manipulation_recv_tcp.c')
-rw-r--r-- | src/transport/test_transport_api_manipulation_recv_tcp.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c index 7aaa9caee..ffb725efd 100644 --- a/src/transport/test_transport_api_manipulation_recv_tcp.c +++ b/src/transport/test_transport_api_manipulation_recv_tcp.c | |||
@@ -197,21 +197,25 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
197 | 197 | ||
198 | if (messages_recv <= 1) | 198 | if (messages_recv <= 1) |
199 | { | 199 | { |
200 | /* Received non-delayed message */ | 200 | /* Received non-delayed message */ |
201 | dur_normal = GNUNET_TIME_absolute_get_duration(start_normal); | 201 | dur_normal = GNUNET_TIME_absolute_get_duration(start_normal); |
202 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 202 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
203 | "Received non-delayed message %u after %s\n", | 203 | "Received non-delayed message %u after %s\n", |
204 | messages_recv, | 204 | messages_recv, |
205 | GNUNET_STRINGS_relative_time_to_string (dur_normal, | 205 | GNUNET_STRINGS_relative_time_to_string (dur_normal, |
206 | GNUNET_YES)); | 206 | GNUNET_YES)); |
207 | 207 | ||
208 | struct GNUNET_ATS_Information ats[2]; | 208 | struct GNUNET_ATS_Properties prop; |
209 | ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY); | 209 | struct GNUNET_TIME_Relative delay; |
210 | ats[0].value = htonl (1000 * 1000LL); | 210 | |
211 | ats[1].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); | 211 | delay.rel_value_us = 1000 * 1000LL; |
212 | ats[1].value = htonl (10); | 212 | memset (&prop, 0, sizeof (prop)); |
213 | 213 | prop.distance = 10; | |
214 | GNUNET_TRANSPORT_set_traffic_metric (p1->th, &p2->id, GNUNET_YES, GNUNET_NO, ats, 2); | 214 | GNUNET_TRANSPORT_set_traffic_metric (p1->th, |
215 | &p2->id, | ||
216 | &prop, | ||
217 | delay, | ||
218 | GNUNET_TIME_UNIT_ZERO); | ||
215 | send_task = GNUNET_SCHEDULER_add_now (&sendtask, NULL); | 219 | send_task = GNUNET_SCHEDULER_add_now (&sendtask, NULL); |
216 | } | 220 | } |
217 | if (2 == messages_recv) | 221 | if (2 == messages_recv) |