missing distance metrics in transport stuffs
authorNathan S. Evans <evans@in.tum.de>
Wed, 28 Apr 2010 16:36:39 +0000 (16:36 +0000)
committerNathan S. Evans <evans@in.tum.de>
Wed, 28 Apr 2010 16:36:39 +0000 (16:36 +0000)
src/transport/gnunet-service-transport.c
src/transport/transport_api.c

index 8af5c6d24b12825b67354a4b2f15fe27c78bf7af..bb6686a42d22c80d94a732a433077a9c50878fd4 100644 (file)
@@ -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)
index affa522de88d5cb638d9e8ac4f49980257071a35..a392b65fb104dfb084073de3db3a7e1a9b946665 100644 (file)
@@ -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,