From 20360d06df924f4a02b1da30c4a3ab0fe28014ea Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Wed, 28 Apr 2010 16:36:39 +0000 Subject: [PATCH] missing distance metrics in transport stuffs --- src/transport/gnunet-service-transport.c | 4 +++- src/transport/transport_api.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 8af5c6d24..bb6686a42 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -3177,6 +3177,7 @@ handle_payload_message (const struct GNUNET_MessageHeader *message, im->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RECV); im->latency = GNUNET_TIME_relative_hton (n->latency); im->peer = n->id; + im->distance = ntohl(n->distance); memcpy (&im[1], message, msize); cpos = clients; while (cpos != NULL) @@ -3278,6 +3279,7 @@ check_pending_validation (void *cls, n->latency = fal->latency; else n->latency.value = (fal->latency.value + n->latency.value) / 2; + n->distance = fal->distance; if (GNUNET_NO == n->received_pong) { @@ -4043,7 +4045,7 @@ handle_ping(void *cls, const struct GNUNET_MessageHeader *message, static struct GNUNET_TIME_Relative plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *message, - unsigned int distance, + uint32_t distance, struct Session *session, const char *sender_address, size_t sender_address_len) diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index affa522de..a392b65fb 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -1497,7 +1497,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) if (h->nc_cb != NULL) h->nc_cb (h->cls, &n->id, GNUNET_TIME_relative_ntoh (cim->latency), - ntohs (cim->distance)); + ntohl (cim->distance)); break; case GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT: if (size != sizeof (struct DisconnectInfoMessage)) @@ -1587,7 +1587,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) } if (h->rec != NULL) h->rec (h->cls, &im->peer, imm, - GNUNET_TIME_relative_ntoh (im->latency), ntohs(im->distance)); + GNUNET_TIME_relative_ntoh (im->latency), ntohl(im->distance)); break; default: GNUNET_log (GNUNET_ERROR_TYPE_ERROR, -- 2.25.1