aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_clients.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport_clients.c')
-rw-r--r--src/transport/gnunet-service-transport_clients.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c
index 23fc7278b..610dda021 100644
--- a/src/transport/gnunet-service-transport_clients.c
+++ b/src/transport/gnunet-service-transport_clients.c
@@ -474,30 +474,22 @@ client_disconnect_notification (void *cls, struct GNUNET_SERVER_Client *client)
474static void 474static void
475notify_client_about_neighbour (void *cls, 475notify_client_about_neighbour (void *cls,
476 const struct GNUNET_PeerIdentity *peer, 476 const struct GNUNET_PeerIdentity *peer,
477 const struct GNUNET_ATS_Information *ats,
478 uint32_t ats_count,
479 const struct GNUNET_HELLO_Address *address, 477 const struct GNUNET_HELLO_Address *address,
480 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 478 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
481 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 479 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
482{ 480{
483 struct TransportClient *tc = cls; 481 struct TransportClient *tc = cls;
484 struct ConnectInfoMessage *cim; 482 struct ConnectInfoMessage *cim;
485 struct GNUNET_ATS_Information *ap; 483 size_t size = sizeof (struct ConnectInfoMessage);
486 size_t size =
487 sizeof (struct ConnectInfoMessage) +
488 ats_count * sizeof (struct GNUNET_ATS_Information);
489 char buf[size] GNUNET_ALIGN; 484 char buf[size] GNUNET_ALIGN;
490 485
491 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE); 486 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
492 cim = (struct ConnectInfoMessage *) buf; 487 cim = (struct ConnectInfoMessage *) buf;
493 cim->header.size = htons (size); 488 cim->header.size = htons (size);
494 cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT); 489 cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
495 cim->ats_count = htonl (ats_count);
496 cim->id = *peer; 490 cim->id = *peer;
497 cim->quota_in = bandwidth_in; 491 cim->quota_in = bandwidth_in;
498 cim->quota_out = bandwidth_out; 492 cim->quota_out = bandwidth_out;
499 ap = (struct GNUNET_ATS_Information *) &cim[1];
500 memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
501 unicast (tc, &cim->header, GNUNET_NO); 493 unicast (tc, &cim->header, GNUNET_NO);
502} 494}
503 495
@@ -898,7 +890,6 @@ compose_address_iterate_response_message (const struct GNUNET_PeerIdentity
898 */ 890 */
899static void 891static void
900output_address (void *cls, const struct GNUNET_PeerIdentity *peer, 892output_address (void *cls, const struct GNUNET_PeerIdentity *peer,
901 const struct GNUNET_ATS_Information *ats, uint32_t ats_count,
902 const struct GNUNET_HELLO_Address *address, 893 const struct GNUNET_HELLO_Address *address,
903 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 894 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
904 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 895 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
@@ -965,7 +956,7 @@ clients_handle_address_iterate (void *cls, struct GNUNET_SERVER_Client *client,
965 /* just return one neighbour */ 956 /* just return one neighbour */
966 address = GST_neighbour_get_current_address (&msg->peer); 957 address = GST_neighbour_get_current_address (&msg->peer);
967 if (address != NULL) 958 if (address != NULL)
968 output_address (tc, &msg->peer, NULL, 0, address, 959 output_address (tc, &msg->peer, address,
969 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, 960 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
970 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT); 961 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT);
971 } 962 }