diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-17 09:45:17 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-17 09:45:17 +0000 |
commit | 6ce568dd2050bda7acb9c84ffa6041b2bd88fab8 (patch) | |
tree | 6e18a972e2e9af6b85319c0bf81835363ec85020 /src/ats | |
parent | a03e7fc2d88d50ecbbc2089a8d975e6107e291dd (diff) | |
download | gnunet-6ce568dd2050bda7acb9c84ffa6041b2bd88fab8.tar.gz gnunet-6ce568dd2050bda7acb9c84ffa6041b2bd88fab8.zip |
fix
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 2 | ||||
-rw-r--r-- | src/ats/test_ats_api_scheduling.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index b12a90bd4..af4669dbd 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -268,7 +268,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer, | |||
268 | GNUNET_free (aa); | 268 | GNUNET_free (aa); |
269 | } | 269 | } |
270 | for (i=0;i<atsi_count;i++) | 270 | for (i=0;i<atsi_count;i++) |
271 | switch (atsi[i].type) | 271 | switch (ntohl (atsi[i].type)) |
272 | { | 272 | { |
273 | case GNUNET_ATS_UTILIZATION_UP: | 273 | case GNUNET_ATS_UTILIZATION_UP: |
274 | old->atsp_utilization_out.value__ = atsi[i].value; | 274 | old->atsp_utilization_out.value__ = atsi[i].value; |
diff --git a/src/ats/test_ats_api_scheduling.c b/src/ats/test_ats_api_scheduling.c index 7dfd887fd..201855283 100644 --- a/src/ats/test_ats_api_scheduling.c +++ b/src/ats/test_ats_api_scheduling.c | |||
@@ -207,18 +207,18 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
207 | 207 | ||
208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing ATS info creation\n"); | 208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing ATS info creation\n"); |
209 | 209 | ||
210 | atsi[0].type = htons (1); | 210 | atsi[0].type = htonl (GNUNET_ATS_UTILIZATION_UP); |
211 | atsi[0].type = htons (1); | 211 | atsi[0].value = htonl (1024); |
212 | 212 | ||
213 | GNUNET_ATS_address_update(ats, &p[0].id, addr[0].plugin, addr[0].addr, addr[0].addr_len, addr[0].session, atsi, 1); | 213 | GNUNET_ATS_address_update(ats, &p[0].id, addr[0].plugin, addr[0].addr, addr[0].addr_len, addr[0].session, atsi, 1); |
214 | 214 | ||
215 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing ATS info merging\n"); | 215 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing ATS info update\n"); |
216 | 216 | ||
217 | atsi[0].type = htons (1); | 217 | atsi[0].type = htonl (GNUNET_ATS_UTILIZATION_UP); |
218 | atsi[0].type = htons (2); | 218 | atsi[0].value = htonl (2048); |
219 | 219 | ||
220 | atsi[1].type = htons (2); | 220 | atsi[1].type = htonl (GNUNET_ATS_UTILIZATION_DOWN); |
221 | atsi[1].type = htons (2); | 221 | atsi[1].value = htonl (1024); |
222 | 222 | ||
223 | GNUNET_ATS_address_update(ats, &p[0].id, addr[0].plugin, addr[0].addr, addr[0].addr_len, addr[0].session, atsi, 2); | 223 | GNUNET_ATS_address_update(ats, &p[0].id, addr[0].plugin, addr[0].addr, addr[0].addr_len, addr[0].session, atsi, 2); |
224 | 224 | ||