diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-11-30 14:23:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-11-30 14:23:35 +0000 |
commit | c1c5fa7d21fbacf2135d3006af5edc28c91cfa26 (patch) | |
tree | 1d55118a815de4ea4f9512682f730b36bd59072f /src/fs/gnunet-service-fs.c | |
parent | 408533b0af6201d685c7d05d1834bc5b1a7f4975 (diff) | |
download | gnunet-c1c5fa7d21fbacf2135d3006af5edc28c91cfa26.tar.gz gnunet-c1c5fa7d21fbacf2135d3006af5edc28c91cfa26.zip |
grab latency data
Diffstat (limited to 'src/fs/gnunet-service-fs.c')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 0ed9299e6..f02e85bba 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "gnunet_protocols.h" | 39 | #include "gnunet_protocols.h" |
40 | #include "gnunet_signatures.h" | 40 | #include "gnunet_signatures.h" |
41 | #include "gnunet_statistics_service.h" | 41 | #include "gnunet_statistics_service.h" |
42 | #include "gnunet_transport_service.h" | ||
42 | #include "gnunet_util_lib.h" | 43 | #include "gnunet_util_lib.h" |
43 | #include "gnunet-service-fs_indexing.h" | 44 | #include "gnunet-service-fs_indexing.h" |
44 | #include "fs.h" | 45 | #include "fs.h" |
@@ -1582,8 +1583,17 @@ destroy_pending_request (struct PendingRequest *pr) | |||
1582 | static struct GNUNET_TIME_Relative | 1583 | static struct GNUNET_TIME_Relative |
1583 | get_latency (const struct GNUNET_TRANSPORT_ATS_Information *atsi) | 1584 | get_latency (const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
1584 | { | 1585 | { |
1585 | /* FIXME: extract latency data from 'atsi' */ | 1586 | while ( (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) && |
1586 | return GNUNET_TIME_UNIT_SECONDS; | 1587 | (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY) ) |
1588 | atsi++; | ||
1589 | if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) | ||
1590 | { | ||
1591 | GNUNET_break (0); | ||
1592 | /* how can we not have latency data? */ | ||
1593 | return GNUNET_TIME_UNIT_SECONDS; | ||
1594 | } | ||
1595 | return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | ||
1596 | ntohl (atsi->value)); | ||
1587 | } | 1597 | } |
1588 | 1598 | ||
1589 | 1599 | ||