From f44c0036572d5557d2496748a4190a61e40e61ff Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 22 Oct 2011 21:59:27 +0000 Subject: replacing 0-terminated atsi-array with array+length in core API (and the core-connect IPC) --- src/hostlist/gnunet-daemon-hostlist.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/hostlist/gnunet-daemon-hostlist.c') diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index fb23d2345..2ef807444 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c @@ -136,14 +136,17 @@ core_init (void *cls, struct GNUNET_CORE_Handle *server, /** * Core handler for p2p hostlist advertisements + * + * @param atsi_count number of records in 'atsi' */ static int advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi) + const struct GNUNET_ATS_Information *atsi, + unsigned int atsi_count) { GNUNET_assert (NULL != client_adv_handler); - return (*client_adv_handler) (cls, peer, message, atsi); + return (*client_adv_handler) (cls, peer, message, atsi, atsi_count); } @@ -153,20 +156,22 @@ advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer, * @param cls closure * @param peer peer identity this notification is about * @param atsi performance data + * @param atsi_count number of records in 'atsi' */ static void connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *atsi) + const struct GNUNET_ATS_Information *atsi, + unsigned int atsi_count) { if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity))) return; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "A new peer connected, notifying client and server\n"); if (NULL != client_ch) - (*client_ch) (cls, peer, atsi); + (*client_ch) (cls, peer, atsi, atsi_count); #if HAVE_MHD if (NULL != server_ch) - (*server_ch) (cls, peer, atsi); + (*server_ch) (cls, peer, atsi, atsi_count); #endif } -- cgit v1.2.3