aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-09-29 21:42:52 +0000
committerBart Polot <bart@net.in.tum.de>2011-09-29 21:42:52 +0000
commitbf698bec316cc81861df372d40d81ee32cdfec4a (patch)
tree877b9132c8d34362063ccf6f66805213d68dcfcc /src/mesh/gnunet-service-mesh.c
parentbd62a37da1a7d0936e189c885b6c58866a169663 (diff)
downloadgnunet-bf698bec316cc81861df372d40d81ee32cdfec4a.tar.gz
gnunet-bf698bec316cc81861df372d40d81ee32cdfec4a.zip
WiP
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r--src/mesh/gnunet-service-mesh.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 670c2f973..0d3d0211b 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -60,7 +60,7 @@
60 60
61#define ID_ANNOUNCE_TIME GNUNET_TIME_relative_multiply(\ 61#define ID_ANNOUNCE_TIME GNUNET_TIME_relative_multiply(\
62 GNUNET_TIME_UNIT_SECONDS,\ 62 GNUNET_TIME_UNIT_SECONDS,\
63 5) 63 10)
64 64
65 65
66/******************************************************************************/ 66/******************************************************************************/
@@ -549,13 +549,15 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
549 * - Set data expiration in function of X 549 * - Set data expiration in function of X
550 * - Adapt X to churn 550 * - Adapt X to churn
551 */ 551 */
552 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: DHT_put for ID %s started.\n",
553 GNUNET_h2s_full (&my_full_id.hashPubKey));
552 GNUNET_DHT_put (dht_handle, /* DHT handle */ 554 GNUNET_DHT_put (dht_handle, /* DHT handle */
553 &my_full_id.hashPubKey, /* Key to use */ 555 &my_full_id.hashPubKey, /* Key to use */
554 10U, /* Replication level */ 556 10U, /* Replication level */
555 GNUNET_DHT_RO_RECORD_ROUTE, /* DHT options */ 557 GNUNET_DHT_RO_RECORD_ROUTE, /* DHT options */
556 GNUNET_BLOCK_TYPE_TEST, /* Block type */ 558 GNUNET_BLOCK_TYPE_TEST, /* Block type */
557 0, /* Size of the data */ 559 sizeof(my_full_id), /* Size of the data */
558 NULL, /* Data itself */ 560 &my_full_id, /* Data itself */
559 GNUNET_TIME_absolute_get_forever (), /* Data expiration */ 561 GNUNET_TIME_absolute_get_forever (), /* Data expiration */
560 GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */ 562 GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */
561#if MESH_DEBUG 563#if MESH_DEBUG
@@ -2090,13 +2092,16 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
2090 struct GNUNET_PeerIdentity pi; 2092 struct GNUNET_PeerIdentity pi;
2091 int i; 2093 int i;
2092 2094
2095 GNUNET_PEER_resolve (path_info->peer->id, &pi);
2096 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
2097 "MESH: Got results from DHT for %s\n",
2098 GNUNET_h2s_full(&pi.hashPubKey));
2093 if (NULL == get_path || NULL == put_path) 2099 if (NULL == get_path || NULL == put_path)
2094 { 2100 {
2095 if (NULL == path_info->peer->path_head) 2101 if (NULL == path_info->peer->path_head)
2096 { 2102 {
2097 // Find ourselves some alternate initial path to the destination: retry 2103 // Find ourselves some alternate initial path to the destination: retry
2098 GNUNET_DHT_get_stop (path_info->peer->dhtget); 2104 GNUNET_DHT_get_stop (path_info->peer->dhtget);
2099 GNUNET_PEER_resolve (path_info->peer->id, &pi);
2100 path_info->peer->dhtget = GNUNET_DHT_get_start (dht_handle, /* handle */ 2105 path_info->peer->dhtget = GNUNET_DHT_get_start (dht_handle, /* handle */
2101 GNUNET_TIME_UNIT_FOREVER_REL, /* timeout */ 2106 GNUNET_TIME_UNIT_FOREVER_REL, /* timeout */
2102 GNUNET_BLOCK_TYPE_TEST, /* type */ 2107 GNUNET_BLOCK_TYPE_TEST, /* type */
@@ -2565,7 +2570,7 @@ handle_local_connect_add (void *cls, struct GNUNET_SERVER_Client *client,
2565 MESH_TunnelNumber tid; 2570 MESH_TunnelNumber tid;
2566 struct MeshPeerInfo *peer_info; 2571 struct MeshPeerInfo *peer_info;
2567 2572
2568 2573 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "MESH: Got connection request\n");
2569 /* Sanity check for client registration */ 2574 /* Sanity check for client registration */
2570 if (NULL == (c = client_get (client))) 2575 if (NULL == (c = client_get (client)))
2571 { 2576 {
@@ -2600,7 +2605,8 @@ handle_local_connect_add (void *cls, struct GNUNET_SERVER_Client *client,
2600 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 2605 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
2601 return; 2606 return;
2602 } 2607 }
2603 2608 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "MESH: for %s\n",
2609 GNUNET_h2s_full(&peer_msg->peer.hashPubKey));
2604 peer_info = peer_info_get (&peer_msg->peer); 2610 peer_info = peer_info_get (&peer_msg->peer);
2605 2611
2606 /* Start DHT search if needed, otherwise just add peer to tunnel. */ 2612 /* Start DHT search if needed, otherwise just add peer to tunnel. */
@@ -2995,17 +3001,23 @@ static void
2995core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 3001core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
2996 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 3002 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
2997{ 3003{
2998// GNUNET_PEER_Id pid;
2999 struct MeshPeerInfo *peer_info; 3004 struct MeshPeerInfo *peer_info;
3000 struct MeshPeerPath *path; 3005 struct MeshPeerPath *path;
3001 3006
3002 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: Peer connected\n"); 3007// GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: Peer connected\n");
3008// GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: %s\n",
3009// GNUNET_h2s(&my_full_id.hashPubKey));
3003 peer_info = peer_info_get (peer); 3010 peer_info = peer_info_get (peer);
3004 if (myid == peer_info->id) 3011 if (myid == peer_info->id)
3005 { 3012 {
3006 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: (self)\n"); 3013// GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: (self)\n");
3007 return; 3014 return;
3008 } 3015 }
3016 else
3017 {
3018// GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: %s\n",
3019// GNUNET_h2s(&peer->hashPubKey));
3020 }
3009 path = path_new (2); 3021 path = path_new (2);
3010 path->peers[0] = myid; 3022 path->peers[0] = myid;
3011 path->peers[1] = peer_info->id; 3023 path->peers[1] = peer_info->id;