diff options
Diffstat (limited to 'src/peerinfo/gnunet-service-peerinfo.c')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 68024a90a..55d4177cf 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -90,6 +90,7 @@ static char *networkIdDirectory; | |||
90 | static struct GNUNET_STATISTICS_Handle *stats; | 90 | static struct GNUNET_STATISTICS_Handle *stats; |
91 | 91 | ||
92 | 92 | ||
93 | |||
93 | /** | 94 | /** |
94 | * Notify all clients in the notify list about the | 95 | * Notify all clients in the notify list about the |
95 | * given host entry changing. | 96 | * given host entry changing. |
@@ -638,9 +639,10 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
638 | { | 639 | { |
639 | const struct ListPeerMessage *lpm; | 640 | const struct ListPeerMessage *lpm; |
640 | struct GNUNET_SERVER_TransmitContext *tc; | 641 | struct GNUNET_SERVER_TransmitContext *tc; |
642 | int friend_only; | ||
641 | 643 | ||
642 | lpm = (const struct ListPeerMessage *) message; | 644 | lpm = (const struct ListPeerMessage *) message; |
643 | GNUNET_break (0 == ntohl (lpm->reserved)); | 645 | friend_only = ntohl (lpm->include_friend_only); |
644 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n", | 646 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n", |
645 | "GET", GNUNET_i2s (&lpm->peer)); | 647 | "GET", GNUNET_i2s (&lpm->peer)); |
646 | tc = GNUNET_SERVER_transmit_context_create (client); | 648 | tc = GNUNET_SERVER_transmit_context_create (client); |
@@ -663,8 +665,12 @@ static void | |||
663 | handle_get_all (void *cls, struct GNUNET_SERVER_Client *client, | 665 | handle_get_all (void *cls, struct GNUNET_SERVER_Client *client, |
664 | const struct GNUNET_MessageHeader *message) | 666 | const struct GNUNET_MessageHeader *message) |
665 | { | 667 | { |
668 | const struct ListAllPeersMessage *lapm; | ||
666 | struct GNUNET_SERVER_TransmitContext *tc; | 669 | struct GNUNET_SERVER_TransmitContext *tc; |
670 | int friend_only; | ||
667 | 671 | ||
672 | lapm = (const struct ListAllPeersMessage *) message; | ||
673 | friend_only = ntohl (lapm->include_friend_only); | ||
668 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL"); | 674 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL"); |
669 | tc = GNUNET_SERVER_transmit_context_create (client); | 675 | tc = GNUNET_SERVER_transmit_context_create (client); |
670 | GNUNET_CONTAINER_multihashmap_iterate (hostmap, &add_to_tc, tc); | 676 | GNUNET_CONTAINER_multihashmap_iterate (hostmap, &add_to_tc, tc); |
@@ -709,7 +715,11 @@ static void | |||
709 | handle_notify (void *cls, struct GNUNET_SERVER_Client *client, | 715 | handle_notify (void *cls, struct GNUNET_SERVER_Client *client, |
710 | const struct GNUNET_MessageHeader *message) | 716 | const struct GNUNET_MessageHeader *message) |
711 | { | 717 | { |
712 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "NOTIFY"); | 718 | struct NotifyMessage *nm = (struct NotifyMessage *) message; |
719 | int friend_only; | ||
720 | |||
721 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "NOTIFY"); | ||
722 | friend_only = ntohl (nm->include_friend_only); | ||
713 | GNUNET_SERVER_client_mark_monitor (client); | 723 | GNUNET_SERVER_client_mark_monitor (client); |
714 | GNUNET_SERVER_notification_context_add (notify_list, client); | 724 | GNUNET_SERVER_notification_context_add (notify_list, client); |
715 | GNUNET_CONTAINER_multihashmap_iterate (hostmap, &do_notify_entry, client); | 725 | GNUNET_CONTAINER_multihashmap_iterate (hostmap, &do_notify_entry, client); |
@@ -773,9 +783,9 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
773 | {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET, | 783 | {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET, |
774 | sizeof (struct ListPeerMessage)}, | 784 | sizeof (struct ListPeerMessage)}, |
775 | {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL, | 785 | {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL, |
776 | sizeof (struct GNUNET_MessageHeader)}, | 786 | sizeof (struct ListAllPeersMessage)}, |
777 | {&handle_notify, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY, | 787 | {&handle_notify, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY, |
778 | sizeof (struct GNUNET_MessageHeader)}, | 788 | sizeof (struct NotifyMessage)}, |
779 | {NULL, NULL, 0, 0} | 789 | {NULL, NULL, 0, 0} |
780 | }; | 790 | }; |
781 | char *peerdir; | 791 | char *peerdir; |