aboutsummaryrefslogtreecommitdiff
path: root/src/core/gnunet-service-core_clients.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-11 12:33:07 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-11 12:33:07 +0000
commitbc31c9fbcf465b4d4960a335e79115ffcd00ee43 (patch)
treedf8e2998da7021055545c169a92a1be616187751 /src/core/gnunet-service-core_clients.c
parentdf38cef29b85922924f02af1761e29252b6ec6a0 (diff)
downloadgnunet-bc31c9fbcf465b4d4960a335e79115ffcd00ee43.tar.gz
gnunet-bc31c9fbcf465b4d4960a335e79115ffcd00ee43.zip
make client with an empty list of handlers count as having a handler for *all* message types
Diffstat (limited to 'src/core/gnunet-service-core_clients.c')
-rw-r--r--src/core/gnunet-service-core_clients.c4
1 files changed, 4 insertions, 0 deletions
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,
190{ 190{
191 unsigned int i; 191 unsigned int i;
192 192
193 if (c->tcnt == 0)
194 return GNUNET_YES; /* peer without handlers matches ALL */
193 for (i=0;i<c->tcnt;i++) 195 for (i=0;i<c->tcnt;i++)
194 if (type == c->types[i]) 196 if (type == c->types[i])
195 return GNUNET_YES; 197 return GNUNET_YES;
@@ -622,6 +624,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
622 624
623 old_match = GSC_TYPEMAP_test_match (tmap_old, client->types, client->tcnt); 625 old_match = GSC_TYPEMAP_test_match (tmap_old, client->types, client->tcnt);
624 new_match = GSC_TYPEMAP_test_match (tmap_new, client->types, client->tcnt); 626 new_match = GSC_TYPEMAP_test_match (tmap_new, client->types, client->tcnt);
627 if (client->tcnt == 0)
628 new_match = GNUNET_YES; /* empty list matches ALL */
625 if (old_match == new_match) 629 if (old_match == new_match)
626 return; /* no change */ 630 return; /* no change */
627 if (old_match == GNUNET_NO) 631 if (old_match == GNUNET_NO)