From 1e1ec14461361419b17e1933a3ac766b2e7ecec9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 5 Oct 2011 13:22:54 +0000 Subject: [PATCH] tell transport to connect, not core --- src/mesh/Makefile.am | 1 + src/mesh/mesh_api.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesh/Makefile.am b/src/mesh/Makefile.am index 3623a48ad..30bc332c7 100644 --- a/src/mesh/Makefile.am +++ b/src/mesh/Makefile.am @@ -22,6 +22,7 @@ libgnunetmesh_la_SOURCES = \ mesh_api.c mesh_protocol.h libgnunetmesh_la_LIBADD = \ $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ $(top_builddir)/src/core/libgnunetcore.la \ $(GN_LIBINTL) $(XLIB) libgnunetmesh_la_LDFLAGS = \ diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 5bb7d1403..a1396cd08 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -129,6 +130,7 @@ struct peer_list struct GNUNET_MESH_Handle { struct GNUNET_CORE_Handle *core; + struct GNUNET_TRANSPORT_Handle *transport; struct GNUNET_MESH_MessageHandler *handlers; struct GNUNET_PeerIdentity myself; unsigned int connected_to_core; @@ -657,7 +659,7 @@ GNUNET_MESH_peer_request_connect_all (struct GNUNET_MESH_Handle *handle, GNUNET_CONTAINER_DLL_insert_after (handle->pending_tunnels.head, handle->pending_tunnels.tail, handle->pending_tunnels.tail, tunnel); - (void) GNUNET_CORE_peer_request_connect (handle->core, peers, NULL, NULL); + GNUNET_TRANSPORT_try_connect (handle->transport, peers); } return &tunnel->tunnel; @@ -874,6 +876,8 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_CORE_connect (cfg, 42, ret, &core_startup, &core_connect, &core_disconnect, NULL, NULL, GNUNET_NO, NULL, GNUNET_NO, core_handlers); + ret->transport = + GNUNET_TRANSPORT_connect (cfg, NULL, NULL, NULL, NULL, NULL); return ret; } @@ -883,6 +887,7 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle) GNUNET_free (handle->handlers); GNUNET_free (handle->hello_message); GNUNET_CORE_disconnect (handle->core); + GNUNET_TRANSPORT_disconnect (handle->transport); struct peer_list_element *element = handle->connected_peers.head; -- 2.25.1