diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-04-11 11:49:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-04-11 11:49:51 +0000 |
commit | 24712c94e185b72c30da25ea1b3a1784bde0defa (patch) | |
tree | 1ca399a023e0cdf48dbf9b411bb4b245081a1100 /src/core/gnunet-service-core_sessions.c | |
parent | a61a4e0ffd7d563f3ae4d758f06a894edee71f58 (diff) | |
download | gnunet-24712c94e185b72c30da25ea1b3a1784bde0defa.tar.gz gnunet-24712c94e185b72c30da25ea1b3a1784bde0defa.zip |
towards fixing #3363: replacing old iteration API with new monitoring API for core (needs testing, gnunet-core incomplete)
Diffstat (limited to 'src/core/gnunet-service-core_sessions.c')
-rw-r--r-- | src/core/gnunet-service-core_sessions.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index 5e8bd537f..eb0013790 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c | |||
@@ -732,59 +732,6 @@ GSC_SESSIONS_transmit (struct GSC_ClientActiveRequest *car, | |||
732 | 732 | ||
733 | 733 | ||
734 | /** | 734 | /** |
735 | * Helper function for #GSC_SESSIONS_handle_client_iterate_peers(). | ||
736 | * | ||
737 | * @param cls the `struct GNUNET_SERVER_TransmitContext` to queue replies | ||
738 | * @param key identity of the connected peer | ||
739 | * @param value the `struct Neighbour` for the peer | ||
740 | * @return #GNUNET_OK (continue to iterate) | ||
741 | */ | ||
742 | static int | ||
743 | queue_connect_message (void *cls, | ||
744 | const struct GNUNET_PeerIdentity *key, | ||
745 | void *value) | ||
746 | { | ||
747 | struct GNUNET_SERVER_TransmitContext *tc = cls; | ||
748 | struct Session *session = value; | ||
749 | struct ConnectNotifyMessage cnm; | ||
750 | |||
751 | /* FIXME: code duplication with clients... */ | ||
752 | cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); | ||
753 | cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT); | ||
754 | cnm.reserved = htonl (0); | ||
755 | cnm.peer = session->peer; | ||
756 | GNUNET_SERVER_transmit_context_append_message (tc, &cnm.header); | ||
757 | return GNUNET_OK; | ||
758 | } | ||
759 | |||
760 | |||
761 | /** | ||
762 | * Handle CORE_ITERATE_PEERS request. For this request type, the client | ||
763 | * does not have to have transmitted an INIT request. All current peers | ||
764 | * are returned, regardless of which message types they accept. | ||
765 | * | ||
766 | * @param cls unused | ||
767 | * @param client client sending the iteration request | ||
768 | * @param message iteration request message | ||
769 | */ | ||
770 | void | ||
771 | GSC_SESSIONS_handle_client_iterate_peers (void *cls, | ||
772 | struct GNUNET_SERVER_Client *client, | ||
773 | const struct GNUNET_MessageHeader *message) | ||
774 | { | ||
775 | struct GNUNET_MessageHeader done_msg; | ||
776 | struct GNUNET_SERVER_TransmitContext *tc; | ||
777 | |||
778 | tc = GNUNET_SERVER_transmit_context_create (client); | ||
779 | GNUNET_CONTAINER_multipeermap_iterate (sessions, &queue_connect_message, tc); | ||
780 | done_msg.size = htons (sizeof (struct GNUNET_MessageHeader)); | ||
781 | done_msg.type = htons (GNUNET_MESSAGE_TYPE_CORE_ITERATE_PEERS_END); | ||
782 | GNUNET_SERVER_transmit_context_append_message (tc, &done_msg); | ||
783 | GNUNET_SERVER_transmit_context_run (tc, GNUNET_TIME_UNIT_FOREVER_REL); | ||
784 | } | ||
785 | |||
786 | |||
787 | /** | ||
788 | * We've received a typemap message from a peer, update ours. | 735 | * We've received a typemap message from a peer, update ours. |
789 | * Notifies clients about the session. | 736 | * Notifies clients about the session. |
790 | * | 737 | * |