From: xrs Date: Tue, 28 Feb 2017 18:37:43 +0000 (+0100) Subject: Merge branch 'master' of ssh://gnunet.org/gnunet X-Git-Tag: gnunet-0.11.0rc0~303 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f82b3a27df765f4a31548ae4efe66dc3dbc42cef;p=oweals%2Fgnunet.git Merge branch 'master' of ssh://gnunet.org/gnunet Conflicts: src/multicast/test_multicast_multipeer.c --- f82b3a27df765f4a31548ae4efe66dc3dbc42cef diff --cc src/multicast/test_multicast.conf index 675776bbc,675776bbc..3081aeecc --- a/src/multicast/test_multicast.conf +++ b/src/multicast/test_multicast.conf @@@ -1,4 -1,4 +1,12 @@@ ++[testbed] ++HOSTNAME = localhost ++ [arm] GLOBAL_POSTFIX=-L ERROR --#PREFIX = sakura -t test-multicast -e cgdb --args ++[multicast] ++#PREFIX = xterm -T peer -e gdb --args ++UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock ++ ++[vpn] ++AUTOSTART = NO diff --cc src/multicast/test_multicast_multipeer.c index aee3a44d5,1b76737f4..0f973517d --- a/src/multicast/test_multicast_multipeer.c +++ b/src/multicast/test_multicast_multipeer.c @@@ -120,30 -121,13 +120,30 @@@ member_join_request (void *cls const struct GNUNET_MessageHeader *join_msg, struct GNUNET_MULTICAST_JoinHandle *jh) { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Member sent a join request.\n"); - + } +int notify (void *cls, + size_t *data_size, + void *data) +{ + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Member sents message to origin.\n"); + + char text[] = "ping"; + *data_size = strlen(text); + GNUNET_memcpy(data, text, *data_size); + + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "len: %i.\n", strlen(text)); + + return GNUNET_YES; +} + - static void + static void member_join_decision (void *cls, int is_admitted, const struct GNUNET_PeerIdentity *peer, @@@ -151,24 -135,17 +151,24 @@@ const struct GNUNET_PeerIdentity *relays, const struct GNUNET_MessageHeader *join_msg) { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, + struct GNUNET_MULTICAST_MemberTransmitHandle *req; + + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Member received a decision from origin: %s\n", (GNUNET_YES == is_admitted)?"accepted":"rejected"); - - result = GNUNET_OK; - GNUNET_SCHEDULER_shutdown (); + + if (GNUNET_YES == is_admitted) + { + req = GNUNET_MULTICAST_member_to_origin (member, + 0, + notify, + NULL); + } } - static void + static void member_replay_frag () { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "member replay frag...\n"); } @@@ -217,25 -196,25 +217,25 @@@ origin_join_request (void *cls result = GNUNET_OK; } - static void + static void origin_replay_frag (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key, - uint64_t fragment_id, - uint64_t flags, - struct GNUNET_MULTICAST_ReplayHandle *rh) + const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key, + uint64_t fragment_id, + uint64_t flags, + struct GNUNET_MULTICAST_ReplayHandle *rh) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin replay fraq msg\n"); } - static void + static void origin_replay_msg (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key, - uint64_t message_id, - uint64_t fragment_offset, - uint64_t flags, - struct GNUNET_MULTICAST_ReplayHandle *rh) + const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key, + uint64_t message_id, + uint64_t fragment_offset, + uint64_t flags, + struct GNUNET_MULTICAST_ReplayHandle *rh) { - + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin replay msg\n"); }