[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17884 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17884 - gnunet/src/mesh |
Date: |
Mon, 31 Oct 2011 18:42:05 +0100 |
Author: bartpolot
Date: 2011-10-31 18:42:05 +0100 (Mon, 31 Oct 2011)
New Revision: 17884
Modified:
gnunet/src/mesh/gnunet-service-mesh.c
Log:
Don't try to send traffic to a peer that is not connected to us
Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2011-10-31 17:12:30 UTC (rev
17883)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2011-10-31 17:42:05 UTC (rev
17884)
@@ -445,6 +445,11 @@
static struct GNUNET_CORE_Handle *core_handle;
/**
+ * Handle to communicate with transport
+ */
+// static struct GNUNET_TRANSPORT_Handle *transport_handle;
+
+/**
* Handle to use DHT
*/
static struct GNUNET_DHT_Handle *dht_handle;
@@ -1139,14 +1144,29 @@
{
struct MeshDataDescriptor *info;
struct MeshPeerInfo *neighbor;
+ struct MeshPeerPath *p;
unsigned int i;
size_t size;
+// GNUNET_TRANSPORT_try_connect();
+
size = ntohs (message->size);
info = GNUNET_malloc (sizeof (struct MeshDataDescriptor));
info->data = GNUNET_malloc (size);
memcpy (info->data, message, size);
neighbor = peer_info_get (peer);
+ for (p = neighbor->path_head; NULL != p; p = p->next)
+ {
+ if (2 == p->length)
+ {
+ break;
+ }
+ }
+ if (NULL == p)
+ {
+ GNUNET_break (0);
+ return;
+ }
i = peer_info_transmit_slot (neighbor);
info->handler_n = i;
info->peer = neighbor;
@@ -4328,6 +4348,7 @@
NULL, /* Don't notify about all
outbound messages */
GNUNET_NO, /* For header-only out
notification */
core_handlers); /* Register these
handlers */
+
if (core_handle == NULL)
{
GNUNET_break (0);
@@ -4359,6 +4380,13 @@
&my_full_id.hashPubKey);
myid = GNUNET_PEER_intern (&my_full_id);
+// // transport_handle = GNUNET_TRANSPORT_connect(c,
+// // &my_full_id,
+// // NULL,
+// // NULL,
+// // NULL,
+// // NULL);
+
dht_handle = GNUNET_DHT_connect (c, 64);
if (dht_handle == NULL)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17884 - gnunet/src/mesh,
gnunet <=