expose our hello to plugins
authorChristian Grothoff <christian@grothoff.org>
Tue, 17 Aug 2010 13:23:23 +0000 (13:23 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 17 Aug 2010 13:23:23 +0000 (13:23 +0000)
src/fs/gnunet-service-fs.c
src/transport/gnunet-service-transport.c
src/transport/plugin_transport.h

index 83bbea183fe9fa3a2951f7cbd623ce2c78f676ea..6b56784db88845926a369cc95f639c9e595b90d5 100644 (file)
@@ -1656,6 +1656,7 @@ transmit_to_peer (void *cls,
                  GNUNET_PEER_change_rc (mb->target_list[i], -1);
                  mb->target_list[i] = 0;
                  mb->used_targets++;
+                 memset (&migm, 0, sizeof (migm));
                  migm.header.size = htons (sizeof (migm) + mb->size);
                  migm.header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
                  migm.type = htonl (mb->type);
index 181d26845f1aa677800c073c0d5ec6e86286eec2..a9a06ac77ad2174932c93cbc3c2ad6d7eed54a18 100644 (file)
@@ -5063,6 +5063,7 @@ create_environment (struct TransportPlugin *plug)
   plug->env.cfg = cfg;
   plug->env.sched = sched;
   plug->env.my_identity = &my_identity;
+  plug->env.our_hello = &our_hello;
   plug->env.cls = plug;
   plug->env.receive = &plugin_env_receive;
   plug->env.notify_address = &plugin_env_notify_address;
index d3dc52f3249954e885c81ccbe94117ac830091d6..8c72f3242c3a0f1e6903bb69e7a20d3f7ec2dac2 100644 (file)
@@ -180,6 +180,12 @@ struct GNUNET_TRANSPORT_PluginEnvironment
    */
   const struct GNUNET_PeerIdentity *my_identity;
 
+  /**
+   * Pointer (!) to our HELLO message.  Note that the address
+   * referred to "*our_hello" might change over time.
+   */
+  const struct GNUNET_HELLO_Message **our_hello;
+
   /**
    * Closure for the various callbacks.
    */