diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-13 13:06:01 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-13 13:06:01 +0000 |
commit | f40b9f4d92412da3a1461f16069c8bbb425bd136 (patch) | |
tree | a1f9df4553aace1af037e465fe39b0f00a05c116 /src/transport/gnunet-service-transport_validation.c | |
parent | 86ad1393cdf6c8b37437c330fce25ebfffbc8ffd (diff) | |
download | gnunet-f40b9f4d92412da3a1461f16069c8bbb425bd136.tar.gz gnunet-f40b9f4d92412da3a1461f16069c8bbb425bd136.zip |
compile
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index e16ccb56b..f0cc12e41 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -394,7 +394,6 @@ add_valid_address (void *cls, const char *tname, | |||
394 | struct ValidationEntry *ve; | 394 | struct ValidationEntry *ve; |
395 | struct GNUNET_PeerIdentity pid; | 395 | struct GNUNET_PeerIdentity pid; |
396 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | 396 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; |
397 | struct GNUNET_TRANSPORT_ATS_Information ats; | ||
398 | 397 | ||
399 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value == 0) | 398 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value == 0) |
400 | return GNUNET_OK; /* expired */ | 399 | return GNUNET_OK; /* expired */ |
@@ -406,10 +405,8 @@ add_valid_address (void *cls, const char *tname, | |||
406 | } | 405 | } |
407 | ve = find_validation_entry (&public_key, &pid, tname, addr, addrlen); | 406 | ve = find_validation_entry (&public_key, &pid, tname, addr, addrlen); |
408 | ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, expiration); | 407 | ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, expiration); |
409 | ats.type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); | 408 | GNUNET_ATS_address_update (GST_ats, &pid, tname, addr, |
410 | ats.value = htonl (0); | 409 | addrlen, NULL, NULL, 0); |
411 | GNUNET_ATS_address_update (GST_ats, &pid, ve->valid_until, tname, NULL, addr, | ||
412 | addrlen, &ats, 1); | ||
413 | return GNUNET_OK; | 410 | return GNUNET_OK; |
414 | } | 411 | } |
415 | 412 | ||
@@ -978,15 +975,13 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | |||
978 | /* validity achieved, remember it! */ | 975 | /* validity achieved, remember it! */ |
979 | ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION); | 976 | ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION); |
980 | { | 977 | { |
981 | struct GNUNET_TRANSPORT_ATS_Information ats[2]; | 978 | struct GNUNET_TRANSPORT_ATS_Information ats; |
982 | 979 | ||
983 | ats[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); | 980 | ats.type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); |
984 | ats[0].value = htonl ((uint32_t) GNUNET_TIME_absolute_get_duration (ve->send_time).rel_value); | 981 | ats.value = htonl ((uint32_t) GNUNET_TIME_absolute_get_duration (ve->send_time).rel_value); |
985 | ats[1].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); | 982 | GNUNET_ATS_address_update (GST_ats, &ve->pid, |
986 | ats[1].value = htonl (0); | 983 | ve->transport_name,ve->addr, ve->addrlen, NULL, |
987 | GNUNET_ATS_address_update (GST_ats, &ve->pid, ve->valid_until, | 984 | &ats, 1); |
988 | ve->transport_name, NULL, ve->addr, ve->addrlen, | ||
989 | ats, 2); | ||
990 | } | 985 | } |
991 | 986 | ||
992 | /* build HELLO to store in PEERINFO */ | 987 | /* build HELLO to store in PEERINFO */ |