From: Matthias Wachs Date: Fri, 24 Aug 2012 15:11:01 +0000 (+0000) Subject: update X-Git-Tag: initial-import-from-subversion-38251~12100 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3f70e71b5e73cb6464bcdccdc69be22cfbc3af69;p=oweals%2Fgnunet.git update --- diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c index 1f0cc5fbb..8c15f8778 100644 --- a/src/transport/plugin_transport_template.c +++ b/src/transport/plugin_transport_template.c @@ -304,6 +304,18 @@ gnunet_plugin_transport_template_init (void *cls) struct GNUNET_TRANSPORT_PluginFunctions *api; struct Plugin *plugin; + if (NULL == env->receive) + { + /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully + initialze the plugin or the API */ + api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); + api->cls = NULL; + api->address_to_string = &template_plugin_address_to_string; + api->string_to_address = &template_plugin_string_to_address; + api->address_pretty_printer = &template_plugin_address_pretty_printer; + return api; + } + plugin = GNUNET_malloc (sizeof (struct Plugin)); plugin->env = env; api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions));