diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-26 23:29:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-26 23:29:54 +0000 |
commit | 54966ddcb4b15a8e84e9b7380781284013786980 (patch) | |
tree | c26a7eabe941753a15bbfe13eb1278db7c1f20ba /src/core | |
parent | 72f297a3fca8fb36719f219db402420e0978d44f (diff) | |
download | gnunet-54966ddcb4b15a8e84e9b7380781284013786980.tar.gz gnunet-54966ddcb4b15a8e84e9b7380781284013786980.zip |
set flag to know that client did call init, thereby avoiding assertion failure on code that expected initialized client
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.h | 5 | ||||
-rw-r--r-- | src/core/core_api.c | 2 | ||||
-rw-r--r-- | src/core/gnunet-service-core.c | 2 |
3 files changed, 8 insertions, 1 deletions
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 | |||
@@ -45,6 +45,11 @@ | |||
45 | #define GNUNET_CORE_OPTION_NOTHING 0 | 45 | #define GNUNET_CORE_OPTION_NOTHING 0 |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * The client did properly initialize the connection. | ||
49 | */ | ||
50 | #define GNUNET_CORE_OPTION_INIT 1 | ||
51 | |||
52 | /** | ||
48 | * Client cares about connectivity changes. | 53 | * Client cares about connectivity changes. |
49 | */ | 54 | */ |
50 | #define GNUNET_CORE_OPTION_SEND_STATUS_CHANGE 4 | 55 | #define GNUNET_CORE_OPTION_SEND_STATUS_CHANGE 4 |
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) | |||
815 | env = GNUNET_MQ_msg_extra (init, | 815 | env = GNUNET_MQ_msg_extra (init, |
816 | sizeof (uint16_t) * h->hcnt, | 816 | sizeof (uint16_t) * h->hcnt, |
817 | GNUNET_MESSAGE_TYPE_CORE_INIT); | 817 | GNUNET_MESSAGE_TYPE_CORE_INIT); |
818 | opt = 0; | 818 | opt = GNUNET_CORE_OPTION_INIT; |
819 | if (NULL != h->inbound_notify) | 819 | if (NULL != h->inbound_notify) |
820 | { | 820 | { |
821 | if (h->inbound_hdr_only) | 821 | 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, | |||
681 | int old_match; | 681 | int old_match; |
682 | int new_match; | 682 | int new_match; |
683 | 683 | ||
684 | if (GNUNET_CORE_OPTION_NOTHING == client->options) | ||
685 | return; /* client did not yet send init */ | ||
684 | old_match = GSC_TYPEMAP_test_match (tmap_old, | 686 | old_match = GSC_TYPEMAP_test_match (tmap_old, |
685 | client->types, | 687 | client->types, |
686 | client->tcnt); | 688 | client->tcnt); |