aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/plugin_transport_template.c12
1 files changed, 12 insertions, 0 deletions
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)
304 struct GNUNET_TRANSPORT_PluginFunctions *api; 304 struct GNUNET_TRANSPORT_PluginFunctions *api;
305 struct Plugin *plugin; 305 struct Plugin *plugin;
306 306
307 if (NULL == env->receive)
308 {
309 /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully
310 initialze the plugin or the API */
311 api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions));
312 api->cls = NULL;
313 api->address_to_string = &template_plugin_address_to_string;
314 api->string_to_address = &template_plugin_string_to_address;
315 api->address_pretty_printer = &template_plugin_address_pretty_printer;
316 return api;
317 }
318
307 plugin = GNUNET_malloc (sizeof (struct Plugin)); 319 plugin = GNUNET_malloc (sizeof (struct Plugin));
308 plugin->env = env; 320 plugin->env = env;
309 api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); 321 api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions));