From bc31c9fbcf465b4d4960a335e79115ffcd00ee43 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 11 Oct 2011 12:33:07 +0000 Subject: [PATCH] make client with an empty list of handlers count as having a handler for *all* message types --- src/core/gnunet-service-core_clients.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c index 6caacb002..c6672c8d2 100644 --- a/src/core/gnunet-service-core_clients.c +++ b/src/core/gnunet-service-core_clients.c @@ -190,6 +190,8 @@ type_match (uint16_t type, { unsigned int i; + if (c->tcnt == 0) + return GNUNET_YES; /* peer without handlers matches ALL */ for (i=0;itcnt;i++) if (type == c->types[i]) return GNUNET_YES; @@ -622,6 +624,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, old_match = GSC_TYPEMAP_test_match (tmap_old, client->types, client->tcnt); new_match = GSC_TYPEMAP_test_match (tmap_new, client->types, client->tcnt); + if (client->tcnt == 0) + new_match = GNUNET_YES; /* empty list matches ALL */ if (old_match == new_match) return; /* no change */ if (old_match == GNUNET_NO) -- 2.25.1