aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-07 22:06:02 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-07 22:06:02 +0000
commitf8c0f7d5c566bbddc2909eceeb63e6ecee591d70 (patch)
treecb03a293b5a5372f18bb114b01d02fd48d76865d /src/transport/gnunet-service-transport.c
parent174ab5aba2bdfde8a4614bf0069a33a7bbe57ce7 (diff)
downloadgnunet-f8c0f7d5c566bbddc2909eceeb63e6ecee591d70.tar.gz
gnunet-f8c0f7d5c566bbddc2909eceeb63e6ecee591d70.zip
more code to get latency in ATSI working; not complete, also now generating a warning -- for a real problem that still needs to be fixed
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 30bcad806..11a8e23ae 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -135,7 +135,7 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
135 size_t msg_size = ntohs (message->size); 135 size_t msg_size = ntohs (message->size);
136 size_t size = 136 size_t size =
137 sizeof (struct InboundMessage) + msg_size + 137 sizeof (struct InboundMessage) + msg_size +
138 sizeof (struct GNUNET_ATS_Information) * ats_count; 138 sizeof (struct GNUNET_ATS_Information) * (ats_count + 1);
139 char buf[size]; 139 char buf[size];
140 struct GNUNET_ATS_Information *ap; 140 struct GNUNET_ATS_Information *ap;
141 141
@@ -162,11 +162,13 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
162 im = (struct InboundMessage *) buf; 162 im = (struct InboundMessage *) buf;
163 im->header.size = htons (size); 163 im->header.size = htons (size);
164 im->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RECV); 164 im->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RECV);
165 im->ats_count = htonl (ats_count); 165 im->ats_count = htonl (ats_count + 1);
166 im->peer = *peer; 166 im->peer = *peer;
167 ap = (struct GNUNET_ATS_Information *) &im[1]; 167 ap = (struct GNUNET_ATS_Information *) &im[1];
168 memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information)); 168 memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
169 memcpy (&ap[ats_count], message, ntohs (message->size)); 169 ap[ats_count].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
170 ap[ats_count].value = htonl ((uint32_t) GST_neighbour_get_latency (peer).rel_value);
171 memcpy (&ap[ats_count + 1], message, ntohs (message->size));
170 172
171 GST_clients_broadcast (&im->header, GNUNET_YES); 173 GST_clients_broadcast (&im->header, GNUNET_YES);
172 174