From 54966ddcb4b15a8e84e9b7380781284013786980 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 26 Sep 2016 23:29:54 +0000 Subject: [PATCH] set flag to know that client did call init, thereby avoiding assertion failure on code that expected initialized client --- src/core/core.h | 5 +++++ src/core/core_api.c | 2 +- src/core/gnunet-service-core.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/core.h b/src/core/core.h index 7c3a5bdd8..7a6ffa62b 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -44,6 +44,11 @@ */ #define GNUNET_CORE_OPTION_NOTHING 0 +/** + * The client did properly initialize the connection. + */ +#define GNUNET_CORE_OPTION_INIT 1 + /** * Client cares about connectivity changes. */ diff --git a/src/core/core_api.c b/src/core/core_api.c index 67f17352d..1c97a19d2 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -815,7 +815,7 @@ reconnect (struct GNUNET_CORE_Handle *h) env = GNUNET_MQ_msg_extra (init, sizeof (uint16_t) * h->hcnt, GNUNET_MESSAGE_TYPE_CORE_INIT); - opt = 0; + opt = GNUNET_CORE_OPTION_INIT; if (NULL != h->inbound_notify) { if (h->inbound_hdr_only) diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 2cf43f111..fe7126d03 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -681,6 +681,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, int old_match; int new_match; + if (GNUNET_CORE_OPTION_NOTHING == client->options) + return; /* client did not yet send init */ old_match = GSC_TYPEMAP_test_match (tmap_old, client->types, client->tcnt); -- 2.25.1