aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-01-26 14:01:56 +0000
committerBart Polot <bart@net.in.tum.de>2012-01-26 14:01:56 +0000
commitf3dbebee8b087c25aab0cef0a0228845a8954596 (patch)
tree347379c30ec41df2c8ec70640bdda63cdc03d61c /src/mesh
parent162fbcf543a045b2046cbe8bfe5113c12fa22105 (diff)
downloadgnunet-f3dbebee8b087c25aab0cef0a0228845a8954596.tar.gz
gnunet-f3dbebee8b087c25aab0cef0a0228845a8954596.zip
Workaround for #2104, initialize local tid when local type destination connects after tunnel connect request by origin
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index e8ce74d97..4448475bc 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -1453,14 +1453,27 @@ peer_info_connect (struct MeshPeerInfo *peer, struct MeshTunnel *t)
1453 return; 1453 return;
1454 } 1454 }
1455 1455
1456 // FIXME always send create path to self
1456 if (p->length > 1) 1457 if (p->length > 1)
1457 { 1458 {
1458 send_create_path (peer, p, t); 1459 send_create_path (peer, p, t);
1459 } 1460 }
1460 else 1461 else
1461 { 1462 {
1463 GNUNET_HashCode hash;
1464
1462 path_destroy (p); 1465 path_destroy (p);
1463 send_client_peer_connected (t, myid); 1466 send_client_peer_connected (t, myid);
1467 t->local_tid_dest = next_local_tid++;
1468 GNUNET_CRYPTO_hash (&t->local_tid_dest, sizeof (MESH_TunnelNumber),
1469 &hash);
1470 if (GNUNET_OK !=
1471 GNUNET_CONTAINER_multihashmap_put (incoming_tunnels, &hash, t,
1472 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))
1473 {
1474 GNUNET_break (0);
1475 return;
1476 }
1464 } 1477 }
1465 } 1478 }
1466 else if (NULL == peer->dhtget) 1479 else if (NULL == peer->dhtget)
@@ -3544,6 +3557,9 @@ dht_get_type_handler (void *cls, struct GNUNET_TIME_Absolute exp,
3544 struct MeshPeerInfo *peer_info; 3557 struct MeshPeerInfo *peer_info;
3545 struct MeshPeerPath *p; 3558 struct MeshPeerPath *p;
3546 3559
3560#if MESH_DEBUG
3561 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: got type DHT result!\n");
3562#endif
3547 if (size != sizeof (struct GNUNET_PeerIdentity)) 3563 if (size != sizeof (struct GNUNET_PeerIdentity))
3548 { 3564 {
3549 GNUNET_break_op (0); 3565 GNUNET_break_op (0);