gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17140 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r17140 - gnunet/src/mesh
Date: Fri, 30 Sep 2011 16:38:23 +0200

Author: bartpolot
Date: 2011-09-30 16:38:23 +0200 (Fri, 30 Sep 2011)
New Revision: 17140

Modified:
   gnunet/src/mesh/Makefile.am
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
Commented out DHT code, removed DHT-dependent test from run set.

Modified: gnunet/src/mesh/Makefile.am
===================================================================
--- gnunet/src/mesh/Makefile.am 2011-09-30 13:34:45 UTC (rev 17139)
+++ gnunet/src/mesh/Makefile.am 2011-09-30 14:38:23 UTC (rev 17140)
@@ -110,7 +110,7 @@
 
 if ENABLE_TEST_RUN
 if HAVE_EXPERIMENTAL
-TESTS = test_mesh_api test_mesh_path_api test_mesh_local_1 test_mesh_local_2
+TESTS = test_mesh_api test_mesh_path_api test_mesh_local_1
 endif
 endif
 

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-09-30 13:34:45 UTC (rev 
17139)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-09-30 14:38:23 UTC (rev 
17140)
@@ -361,7 +361,7 @@
 /************************      DEBUG FUNCTIONS     
****************************/
 
/******************************************************************************/
 
-#if MESH_DEBUG
+#if LATER /* FIXME DHT */
 /**
  * GNUNET_SCHEDULER_Task for printing a message after some operation is done
  * @param cls string to print
@@ -409,7 +409,7 @@
 /**
  * Handle to use DHT
  */
-static struct GNUNET_DHT_Handle *dht_handle;
+//static struct GNUNET_DHT_Handle *dht_handle; FIXME DHT
 
 /**
  * Handle to server
@@ -496,7 +496,8 @@
 announce_application (void *cls, const GNUNET_HashCode * key, void *value)
 {
   /* FIXME are hashes in multihash map equal on all aquitectures? */
-  GNUNET_DHT_put (dht_handle, key, 10U, GNUNET_DHT_RO_RECORD_ROUTE,
+  /* FIXME DHT */
+/*  GNUNET_DHT_put (dht_handle, key, 10U, GNUNET_DHT_RO_RECORD_ROUTE,
                   GNUNET_BLOCK_TYPE_TEST, sizeof (struct GNUNET_PeerIdentity),
                   (const char *) &my_full_id,
 #if MESH_DEBUG
@@ -506,7 +507,7 @@
                   GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
                                             APP_ANNOUNCE_TIME),
                   APP_ANNOUNCE_TIME, NULL, NULL);
-#endif
+#endif*/
   return GNUNET_OK;
 }
 
@@ -556,26 +557,26 @@
    */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: DHT_put for ID %s started.\n",
               GNUNET_h2s_full (&my_full_id.hashPubKey));
-  GNUNET_DHT_put (dht_handle,   /* DHT handle */
-                  &my_full_id.hashPubKey,       /* Key to use */
-                  10U,          /* Replication level */
-                  GNUNET_DHT_RO_RECORD_ROUTE,   /* DHT options */
-                  GNUNET_BLOCK_TYPE_TEST,       /* Block type */
-                  sizeof(my_full_id),   /* Size of the data */
-                  (char *)&my_full_id,  /* Data itself */
-                  GNUNET_TIME_absolute_get_forever (),  /* Data expiration */
-                  GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */
-#if MESH_DEBUG
-                  &mesh_debug, "DHT_put for id completed");
-#else
-                  NULL,         /* Continuation */
-                  NULL);        /* Continuation closure */
-#endif
+//   GNUNET_DHT_put (dht_handle,   /* DHT handle */ FIXME DHT
+//                   &my_full_id.hashPubKey,       /* Key to use */
+//                   10U,          /* Replication level */
+//                   GNUNET_DHT_RO_RECORD_ROUTE,   /* DHT options */
+//                   GNUNET_BLOCK_TYPE_TEST,       /* Block type */
+//                   sizeof(my_full_id),   /* Size of the data */
+//                   (char *)&my_full_id,  /* Data itself */
+//                   GNUNET_TIME_absolute_get_forever (),  /* Data expiration 
*/
+//                   GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */
+// #if MESH_DEBUG
+//                   &mesh_debug, "DHT_put for id completed");
+// #else
+//                   NULL,         /* Continuation */
+//                   NULL);        /* Continuation closure */
+// #endif
   announce_id_task =
       GNUNET_SCHEDULER_add_delayed (ID_ANNOUNCE_TIME, &announce_id, cls);
 }
 
-
+#if LATER /* FIXME DHT */
 /**
  * Function to process paths received for a new peer addition. The recorded
  * paths form the initial tunnel, which can be optimized later.
@@ -596,8 +597,8 @@
                     const struct GNUNET_PeerIdentity *put_path,
                    unsigned int put_path_length,
                     enum GNUNET_BLOCK_Type type, size_t size, const void 
*data);
+#endif
 
-
 
/******************************************************************************/
 /******************      GENERAL HELPER FUNCTIONS      
************************/
 
/******************************************************************************/
@@ -750,24 +751,24 @@
     }
     else
     {
-      struct MeshPathInfo *path_info;
+//       struct MeshPathInfo *path_info;
 
       if (NULL != peer_d->dhtget)
         return;
-      path_info = GNUNET_malloc(sizeof(struct MeshPathInfo));
-      path_info->path = p;
-      path_info->peer = peer_d;
-      path_info->t = peer->tunnels[i];
-      peer_d->dhtget = GNUNET_DHT_get_start(dht_handle,       /* handle */
-                                            GNUNET_TIME_UNIT_FOREVER_REL,     
/* timeout */
-                                            GNUNET_BLOCK_TYPE_TEST,   /* type 
*/
-                                            &id.hashPubKey,   /*key to search 
*/
-                                            4,        /* replication level */
-                                            GNUNET_DHT_RO_RECORD_ROUTE,
-                                            NULL,     /* xquery */
-                                            0,        /* xquery bits */
-                                            &dht_get_id_handler,
-                                            (void *) path_info);
+//       path_info = GNUNET_malloc(sizeof(struct MeshPathInfo)); FIXME DHT
+//       path_info->path = p;
+//       path_info->peer = peer_d;
+//       path_info->t = peer->tunnels[i];
+//       peer_d->dhtget = GNUNET_DHT_get_start(dht_handle,       /* handle */
+//                                             GNUNET_TIME_UNIT_FOREVER_REL,   
  /* timeout */
+//                                             GNUNET_BLOCK_TYPE_TEST,   /* 
type */
+//                                             &id.hashPubKey,   /*key to 
search */
+//                                             4,        /* replication level 
*/
+//                                             GNUNET_DHT_RO_RECORD_ROUTE,
+//                                             NULL,     /* xquery */
+//                                             0,        /* xquery bits */
+//                                             &dht_get_id_handler,
+//                                             (void *) path_info);
     }
   }
 }
@@ -838,6 +839,7 @@
 }
 
 
+#if LATER /* FIXME DHT */
 /**
  * Build a PeerPath from the paths returned from the DHT, reversing the paths
  * to obtain a local peer -> destination path and interning the peer ids.
@@ -904,6 +906,7 @@
 #endif
   return p;
 }
+#endif
 
 
 /**
@@ -2081,7 +2084,7 @@
   return;
 }
 
-
+#if LATER /* FIXME DHT */
 /**
  * Function to process paths received for a new peer addition. The recorded
  * paths form the initial tunnel, which can be optimized later.
@@ -2122,16 +2125,16 @@
     {
       // Find ourselves some alternate initial path to the destination: retry
       GNUNET_DHT_get_stop (path_info->peer->dhtget);
-      path_info->peer->dhtget = GNUNET_DHT_get_start (dht_handle,       /* 
handle */
-                                                      
GNUNET_TIME_UNIT_FOREVER_REL,     /* timeout */
-                                                      GNUNET_BLOCK_TYPE_TEST,  
 /* type */
-                                                      &pi.hashPubKey,   /*key 
to search */
-                                                      4,        /* replication 
level */
-                                                      
GNUNET_DHT_RO_RECORD_ROUTE, 
-                                                      NULL,     /* xquery */
-                                                      0,        /* xquery bits 
*/
-                                                      &dht_get_id_handler,
-                                                      (void *) path_info);
+//       path_info->peer->dhtget = GNUNET_DHT_get_start (dht_handle,       /* 
handle */ FIXME DHT
+//                                                       
GNUNET_TIME_UNIT_FOREVER_REL,     /* timeout */
+//                                                       
GNUNET_BLOCK_TYPE_TEST,   /* type */
+//                                                       &pi.hashPubKey,   
/*key to search */
+//                                                       4,        /* 
replication level */
+//                                                       
GNUNET_DHT_RO_RECORD_ROUTE, 
+//                                                       NULL,     /* xquery */
+//                                                       0,        /* xquery 
bits */
+//                                                       &dht_get_id_handler,
+//                                                       (void *) path_info);
       return;
     }
   }
@@ -2223,27 +2226,27 @@
   if ((NULL == get_path || NULL == put_path) && NULL == peer_info->path_head &&
       NULL == peer_info->dhtget)
   {
-    path_info = GNUNET_malloc (sizeof (struct MeshPathInfo));
-    path_info->peer = peer_info;
-    path_info->t = t;
-    /* we don't have a route to the peer, let's try a direct lookup */
-    peer_info->dhtget = GNUNET_DHT_get_start (dht_handle,
-                                              /* handle */
-                                              GNUNET_TIME_UNIT_FOREVER_REL,
-                                              /* timeout */
-                                              GNUNET_BLOCK_TYPE_TEST,
-                                              /* block type */
-                                              &pi->hashPubKey,
-                                              /* key to look up */
-                                              10U,
-                                              /* replication level */
-                                              GNUNET_DHT_RO_RECORD_ROUTE,
-                                              /* option to dht: record route */
-                                              NULL,     /* xquery */
-                                              0,        /* xquery bits */
-                                              dht_get_id_handler,
-                                              /* callback */
-                                              path_info);       /* closure */
+//     path_info = GNUNET_malloc (sizeof (struct MeshPathInfo)); FIXME DHT
+//     path_info->peer = peer_info;
+//     path_info->t = t;
+//     /* we don't have a route to the peer, let's try a direct lookup */
+//     peer_info->dhtget = GNUNET_DHT_get_start (dht_handle,
+//                                               /* handle */
+//                                               GNUNET_TIME_UNIT_FOREVER_REL,
+//                                               /* timeout */
+//                                               GNUNET_BLOCK_TYPE_TEST,
+//                                               /* block type */
+//                                               &pi->hashPubKey,
+//                                               /* key to look up */
+//                                               10U,
+//                                               /* replication level */
+//                                               GNUNET_DHT_RO_RECORD_ROUTE,
+//                                               /* option to dht: record 
route */
+//                                               NULL,     /* xquery */
+//                                               0,        /* xquery bits */
+//                                               dht_get_id_handler,
+//                                               /* callback */
+//                                               path_info);       /* closure 
*/
     return;
   }
 
@@ -2294,6 +2297,8 @@
   send_client_peer_connected(t, myid);
 }
 
+#endif
+
 
/******************************************************************************/
 /*********************       MESH LOCAL HANDLES      
**************************/
 
/******************************************************************************/
@@ -2667,19 +2672,19 @@
   /* Start DHT search if needed, otherwise just add peer to tunnel. */
   if (NULL == peer_info->dhtget && NULL == peer_info->path_head)
   {
-    path_info = GNUNET_malloc(sizeof(struct MeshPathInfo));
-    path_info->peer = peer_info;
-    path_info->t = t;
-    peer_info->dhtget = GNUNET_DHT_get_start(dht_handle,       /* handle */
-                                            GNUNET_TIME_UNIT_FOREVER_REL,     
/* timeout */
-                                            GNUNET_BLOCK_TYPE_TEST,   /* type 
*/
-                                            &peer_msg->peer.hashPubKey,   
/*key to search */
-                                            4,        /* replication level */
-                                            GNUNET_DHT_RO_RECORD_ROUTE,
-                                            NULL,     /* xquery */
-                                            0,        /* xquery bits */
-                                            &dht_get_id_handler,
-                                            (void *) path_info);
+//     path_info = GNUNET_malloc(sizeof(struct MeshPathInfo));
+//     path_info->peer = peer_info;
+//     path_info->t = t;
+//     peer_info->dhtget = GNUNET_DHT_get_start(dht_handle,       /* handle */ 
FIXME DHT
+//                                          GNUNET_TIME_UNIT_FOREVER_REL,     
/* timeout */
+//                                          GNUNET_BLOCK_TYPE_TEST,   /* type 
*/
+//                                          &peer_msg->peer.hashPubKey,   
/*key to search */
+//                                          4,        /* replication level */
+//                                          GNUNET_DHT_RO_RECORD_ROUTE,
+//                                          NULL,     /* xquery */
+//                                          0,        /* xquery bits */
+//                                          &dht_get_id_handler,
+//                                          (void *) path_info);
   }
   else if (NULL != peer_info->path_head)
   {
@@ -2859,11 +2864,11 @@
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH:  looking in DHT for %s\n",
               GNUNET_h2s_full (&hash));
-  c->dht_get_type =
-      GNUNET_DHT_get_start (dht_handle, GNUNET_TIME_UNIT_FOREVER_REL,
-                            GNUNET_BLOCK_TYPE_TEST, &hash, 10U,
-                            GNUNET_DHT_RO_RECORD_ROUTE, NULL, 0,
-                            &dht_get_type_handler, t);
+//   c->dht_get_type = FIXME DHT
+//       GNUNET_DHT_get_start (dht_handle, GNUNET_TIME_UNIT_FOREVER_REL,
+//                             GNUNET_BLOCK_TYPE_TEST, &hash, 10U,
+//                             GNUNET_DHT_RO_RECORD_ROUTE, NULL, 0,
+//                             &dht_get_type_handler, t);
 
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
   return;
@@ -3174,7 +3179,7 @@
 static void
 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct MeshClient *c;
+//   struct MeshClient *c;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: shutting down\n");
   if (core_handle != NULL)
@@ -3182,14 +3187,14 @@
     GNUNET_CORE_disconnect (core_handle);
     core_handle = NULL;
   }
-  if (dht_handle != NULL)
-  {
-    for (c = clients; NULL != c; c = c->next)
-      if (NULL != c->dht_get_type)
-        GNUNET_DHT_get_stop (c->dht_get_type);
-    GNUNET_DHT_disconnect (dht_handle);
-    dht_handle = NULL;
-  }
+//   if (dht_handle != NULL) FIXME DHT
+//   {
+//     for (c = clients; NULL != c; c = c->next)
+//       if (NULL != c->dht_get_type)
+//         GNUNET_DHT_get_stop (c->dht_get_type);
+//     GNUNET_DHT_disconnect (dht_handle);
+//     dht_handle = NULL;
+//   }
   if (nc != NULL)
   {
     GNUNET_SERVER_notification_context_destroy (nc);
@@ -3263,15 +3268,11 @@
                       &my_full_id.hashPubKey);
   myid = GNUNET_PEER_intern (&my_full_id);
 
-  dht_handle = GNUNET_DHT_connect (c, 64);
-  if (dht_handle == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error connecting to DHT.\
-                   Running without DHT has a severe\
-                   impact in MESH capabilities.\n\
-                   Plase check your configuretion and enable DHT.\n");
-    GNUNET_break (0);
-  }
+//   dht_handle = GNUNET_DHT_connect (c, 64); FIXME DHT
+//   if (dht_handle == NULL)
+//   {
+//     GNUNET_break (0);
+//   }
 
   next_tid = 0;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]