From baab42aeb0b5a6d2a782c9c8e9554908c66fa80c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 16 Jul 2013 08:46:14 +0000 Subject: -proper support for initial listing vs. monitor mode --- src/identity/gnunet-service-identity.c | 10 ++++++---- src/identity/identity_api.c | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c index 6c94f1c88..45c088e44 100644 --- a/src/identity/gnunet-service-identity.c +++ b/src/identity/gnunet-service-identity.c @@ -25,10 +25,6 @@ * * The purpose of this service is to manage private keys that * represent the various egos/pseudonyms/identities of a GNUnet user. - * - * FIXME: - * - hint for 'end of initial list' is not implemented - * (might ALSO be missing in client library!) */ #include "platform.h" #include "gnunet_util_lib.h" @@ -274,6 +270,7 @@ handle_start_message (void *cls, struct GNUNET_SERVER_Client *client, const struct GNUNET_MessageHeader *message) { struct GNUNET_IDENTITY_UpdateMessage *um; + struct GNUNET_IDENTITY_UpdateMessage ume; struct Ego *ego; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -285,6 +282,11 @@ handle_start_message (void *cls, struct GNUNET_SERVER_Client *client, GNUNET_SERVER_notification_context_unicast (nc, client, &um->header, GNUNET_YES); GNUNET_free (um); } + ume.header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE); + ume.header.size = htons (sizeof (struct GNUNET_IDENTITY_UpdateMessage)); + ume.pk_len = htons (0); + ume.name_len = htons (0); + GNUNET_SERVER_notification_context_unicast (nc, client, &ume.header, GNUNET_YES); GNUNET_SERVER_receive_done (client, GNUNET_OK); } diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index f7f1530fc..169a7a2ac 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c @@ -299,6 +299,14 @@ message_handler (void *cls, reschedule_connect (h); return; } + if ( (0 == pk_len) && + (0 == name_len) ) + { + /* end of initial list of data */ + if (NULL != h->cb) + h->cb (h->cb_cls, NULL, NULL, NULL); + return; + } priv = GNUNET_CRYPTO_ecc_decode_key (str, pk_len, GNUNET_YES); if (NULL == priv) { -- cgit v1.2.3