summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp_broadcasting.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-16 05:33:01 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-16 05:33:01 +0100
commitd23a815951413af100c74b38cdd09a01ca1c280a (patch)
tree5fd6a3eae1cd4497dc728917362067a8aded3151 /src/transport/plugin_transport_udp_broadcasting.c
parenta3acd27f0acf30a6c4803ec933c4fe7650bc296c (diff)
removing dead/legacy server/connection logic, except for in tcp/wlan/bt plugins (which will be updated 'later')
Diffstat (limited to 'src/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index a440830fd..c6ddbce9b 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -133,11 +133,10 @@ struct MstContext
*/
static int
broadcast_mst_cb (void *cls,
- void *client,
const struct GNUNET_MessageHeader *message)
{
- struct Plugin *plugin = cls;
- struct MstContext *mc = client;
+ struct MstContext *mc = cls;
+ struct Plugin *plugin = mc->plugin;
struct GNUNET_HELLO_Address *address;
const struct GNUNET_MessageHeader *hello;
const struct UDP_Beacon_Message *msg;
@@ -191,16 +190,20 @@ udp_broadcast_receive (struct Plugin *plugin,
size_t udp_addr_len,
enum GNUNET_ATS_Network_Type network_type)
{
+ struct GNUNET_MessageStreamTokenizer *broadcast_mst;
struct MstContext mc;
+ broadcast_mst = GNUNET_MST_create (&broadcast_mst_cb,
+ &mc);
+ mc.plugin = plugin;
mc.udp_addr = udp_addr;
mc.udp_addr_len = udp_addr_len;
mc.ats_address_network_type = network_type;
- GNUNET_SERVER_mst_receive (plugin->broadcast_mst,
- &mc,
- buf, size,
- GNUNET_NO,
- GNUNET_NO);
+ GNUNET_MST_from_buffer (broadcast_mst,
+ buf, size,
+ GNUNET_NO,
+ GNUNET_NO);
+ GNUNET_MST_destroy (broadcast_mst);
}
@@ -546,10 +549,6 @@ setup_broadcast (struct Plugin *plugin,
return;
}
- /* always create tokenizers */
- plugin->broadcast_mst =
- GNUNET_SERVER_mst_create (&broadcast_mst_cb, plugin);
-
if (GNUNET_YES != plugin->enable_broadcasting)
return; /* We do not send, just receive */
@@ -636,13 +635,6 @@ stop_broadcast (struct Plugin *plugin)
GNUNET_free (p);
}
}
-
- /* Destroy MSTs */
- if (NULL != plugin->broadcast_mst)
- {
- GNUNET_SERVER_mst_destroy (plugin->broadcast_mst);
- plugin->broadcast_mst = NULL;
- }
}
/* end of plugin_transport_udp_broadcasting.c */