Merge branch 'master' of ssh://gnunet.org/gnunet
authorxrs <xrs@mail36.net>
Tue, 28 Feb 2017 18:37:43 +0000 (19:37 +0100)
committerxrs <xrs@mail36.net>
Tue, 28 Feb 2017 18:37:43 +0000 (19:37 +0100)
Conflicts:
src/multicast/test_multicast_multipeer.c

1  2 
src/multicast/Makefile.am
src/multicast/test_multicast.conf
src/multicast/test_multicast_multipeer.c

Simple merge
index 675776bbc3bdc5ee79bdcea91632317eafe04715,675776bbc3bdc5ee79bdcea91632317eafe04715..3081aeecc053a06ba8d70e12d6df738f028582fa
@@@ -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
index aee3a44d5aa84065834fa2fb736bd81b7e5179ca,1b76737f4f90312b0bf1b94ad6bfc1f3cee72af7..0f973517df757876c895896587aae68679713224
@@@ -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,
                        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");
  }