nitpicks
authorChristian Grothoff <christian@grothoff.org>
Fri, 21 May 2010 10:25:12 +0000 (10:25 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 21 May 2010 10:25:12 +0000 (10:25 +0000)
TODO
src/arm/gnunet-service-manager.c
src/fs/gnunet-service-fs.c
src/include/gnunet_testing_lib.h
src/testing/testing_group.c
src/transport/plugin_transport_http.c

diff --git a/TODO b/TODO
index 05a3d32894534357f40b82e8cc4aa78617e980aa..d34756e00acf45de7d9ae62b1ecb1bc183accf7d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -12,6 +12,10 @@ May 16 12:49:50 fs-13737 WARNING Could not access indexed file `ENUTBMBR' at off
     NOTE: corrupted filename in open message
     NOTE: odd directory name in open message
 
+May 21 09:38:37 transport-26713 DEBUG Sending message of size 484 for `HLEV' to `fe80::230:48ff:febb:4bb3:10017' via plugin `tcp'
+May 21 09:38:37 transport-26713 INFO `connect' failed at connection.c:924 with error: Invalid argument
+May 21 09:38:37 tcp DEBUG Failed to create connection to `HLEV' at `[fe80::230:48ff:febb:4bb3]:10017'
+
 
 May 18 10:53:51 transport-8149 WARNING External protocol violation detected at plugin_transport_tcp.c:1275.
 
@@ -80,6 +84,8 @@ May 18 10:53:51 transport-8149 WARNING External protocol violation detected at p
 
 0.9.0pre3:
 * Determine RC bugs and fix those!
+* DATASTORE:
+  - GNUNET_DATASTORE_cancel method not tested
 * TESTING: [Nate]
   - modify configuration to allow controlling connections for non-local starts
   - testbed creation with topology (needs working F2F topology) 
index 15992b9fc820e402a6b91f80c3cc8ff13f18603c..3d3073f7630e255116a9f85cfe7ac2c181ba31cd 100644 (file)
@@ -451,8 +451,7 @@ receiveFromService (void *cls,
   struct GNUNET_TIME_Relative rem;
 
   fc->service_to_client_task = GNUNET_SCHEDULER_NO_TASK;
-  if ( (NULL != tc) &&
-       (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) &&
+  if ( (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) &&
        (fc->first_write_done != GNUNET_YES) )
     {
       closeClientAndServiceSockets (fc, REASON_ERROR);
@@ -556,8 +555,7 @@ forwardToService (void *cls,
   struct GNUNET_TIME_Relative rem;
 
   fc->client_to_service_task = GNUNET_SCHEDULER_NO_TASK;
-  if ( (NULL != tc) &&
-       (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) &&
+  if ( (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) &&
        (fc->first_write_done != GNUNET_YES) )
     {
       closeClientAndServiceSockets (fc, REASON_ERROR);
index 761d9a364c297cea8649f43756bc8cd5b93e69b3..7611f979c3c98d4b5435406b55c19bfaf974dc50 100644 (file)
@@ -880,7 +880,7 @@ consider_migration_gathering ()
     return;
   delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
                                         mig_size);
-  delay = GNUNET_TIME_relative_divide (GNUNET_TIME_UNIT_SECONDS,
+  delay = GNUNET_TIME_relative_divide (delay,
                                       MAX_MIGRATION_QUEUE);
   delay = GNUNET_TIME_relative_max (delay,
                                    min_migration_delay);
index d3ab7cb9bbef8d9bea7e9e26b52bb053e78b5aa8..71bf9f9618b70c1720b20710b47ed2f79439407d 100644 (file)
@@ -658,7 +658,7 @@ enum GNUNET_TESTING_TopologyOption
   GNUNET_TESTING_TOPOLOGY_OPTION_NONE
 };
 
-/*
+/**
  * Takes a peer group and creates a topology based on the
  * one specified.  Creates a topology means generates friend
  * files for the peers so they can only connect to those allowed
@@ -683,11 +683,20 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
                                 enum GNUNET_TESTING_Topology restrict_topology,
                                 char *restrict_transports);
 
-/*
+/**
+ * There are many ways to connect peers that are supported by this function.
+ * To connect peers in the same topology that was created via the
+ * GNUNET_TESTING_create_topology, the topology variable must be set to
+ * GNUNET_TESTING_TOPOLOGY_NONE.  If the topology variable is specified,
+ * a new instance of that topology will be generated and attempted to be
+ * connected.  This could result in some connections being impossible,
+ * because some topologies are non-deterministic.
+ *
  * @param pg the peer group struct representing the running peers
  * @param topology which topology to connect the peers in
  * @param options options for connecting the topology
  * @param option_modifier modifier for options that take a parameter
+ * @return the number of connections that will be attempted, GNUNET_SYSERR on error
  */
 int
 GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
index d777382964de2a4b623fe14c7c36b79b65ec6fcc..1de293617708ce760bc6eb511fb00955532ca83f 100644 (file)
@@ -1691,12 +1691,11 @@ copy_allowed_topology (struct GNUNET_TESTING_PeerGroup *pg)
 }
 
 
-/*
+/**
  * Connect the topology as specified by the PeerConnection's
  * of each peer in the peer group
  *
  * @param pg the peer group we are dealing with
- *
  * @return the number of connections that will be attempted
  */
 static int
@@ -1736,7 +1735,7 @@ connect_topology (struct GNUNET_TESTING_PeerGroup *pg)
 }
 
 
-/*
+/**
  * Takes a peer group and creates a topology based on the
  * one specified.  Creates a topology means generates friend
  * files for the peers so they can only connect to those allowed
@@ -1858,15 +1857,10 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
 #endif
     }
 
-  /**
-   * Use the create clique method to initially set all connections
-   * as blacklisted.
-   */
+  /* Use the create clique method to initially set all connections as blacklisted. */
   create_clique (pg, &blacklist_connections);
   unblacklisted_connections = 0;
-  /**
-   * Un-blacklist connections as per the topology specified
-   */
+  /* Un-blacklist connections as per the topology specified */
   switch (restrict_topology)
     {
     case GNUNET_TESTING_TOPOLOGY_CLIQUE:
@@ -1950,8 +1944,6 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
 #endif
       }
   }
-
-
   return num_connections;
 }
 
@@ -2331,12 +2323,7 @@ perform_dfs (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num)
 
 }
 
-/*
- * @param pg the peer group struct representing the running peers
- * @param topology which topology to connect the peers in
- * @param options options for connecting the topology
- * @param option_modifier modifier for options that take a parameter
- *
+/**
  * There are many ways to connect peers that are supported by this function.
  * To connect peers in the same topology that was created via the
  * GNUNET_TESTING_create_topology, the topology variable must be set to
@@ -2345,6 +2332,11 @@ perform_dfs (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num)
  * connected.  This could result in some connections being impossible,
  * because some topologies are non-deterministic.
  *
+ * @param pg the peer group struct representing the running peers
+ * @param topology which topology to connect the peers in
+ * @param options options for connecting the topology
+ * @param option_modifier modifier for options that take a parameter
+ * @return the number of connections that will be attempted, GNUNET_SYSERR on error
  */
 int
 GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
@@ -2352,8 +2344,6 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
                                  enum GNUNET_TESTING_TopologyOption options,
                                  double option_modifier)
 {
-  int num_connections;
-
   switch (topology)
       {
       case GNUNET_TESTING_TOPOLOGY_CLIQUE:
@@ -2361,80 +2351,81 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating clique topology\n"));
   #endif
-        num_connections = create_clique (pg, &add_actual_connections);
+        create_clique (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING:
   #if VERBOSE_TESTING
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating small world (ring) topology\n"));
   #endif
-        num_connections = create_small_world_ring (pg, &add_actual_connections);
+        create_small_world_ring (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD:
   #if VERBOSE_TESTING
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating small world (2d-torus) topology\n"));
   #endif
-        num_connections = create_small_world (pg, &add_actual_connections);
+        create_small_world (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_RING:
   #if VERBOSE_TESTING
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating ring topology\n"));
   #endif
-        num_connections = create_ring (pg, &add_actual_connections);
+        create_ring (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_2D_TORUS:
   #if VERBOSE_TESTING
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating 2d torus topology\n"));
   #endif
-        num_connections = create_2d_torus (pg, &add_actual_connections);
+        create_2d_torus (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI:
   #if VERBOSE_TESTING
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating Erdos-Renyi topology\n"));
   #endif
-        num_connections = create_erdos_renyi (pg, &add_actual_connections);
+        create_erdos_renyi (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_INTERNAT:
   #if VERBOSE_TESTING
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating InterNAT topology\n"));
   #endif
-        num_connections = create_nated_internet (pg, &add_actual_connections);
+        create_nated_internet (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_SCALE_FREE:
   #if VERBOSE_TESTING
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     _("Creating Scale Free topology\n"));
   #endif
-        num_connections = create_scale_free (pg, &add_actual_connections);
+        create_scale_free (pg, &add_actual_connections);
         break;
       case GNUNET_TESTING_TOPOLOGY_NONE:
         num_connections = copy_allowed_topology(pg);
         break;
       default:
-        GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Unknown topology specification, can't connect peers!\n");
+        GNUNET_log(GNUNET_ERROR_TYPE_WARNING, 
+                  _("Unknown topology specification, can't connect peers!\n"));
         return GNUNET_SYSERR;
       }
 
   switch (options)
     {
-    case GNUNET_TESTING_TOPOLOGY_OPTION_RANDOM: /* Create a random subset of total connections based on parameter */
+    case GNUNET_TESTING_TOPOLOGY_OPTION_RANDOM: 
       choose_random_connections(pg, option_modifier);
       break;
-    case GNUNET_TESTING_TOPOLOGY_OPTION_MINIMUM: /* Create at least X connections per peer (if possible!) */
+    case GNUNET_TESTING_TOPOLOGY_OPTION_MINIMUM: 
       choose_minimum(pg, (unsigned int)option_modifier);
       break;
-    case GNUNET_TESTING_TOPOLOGY_OPTION_DFS: /* Choose a random starting point, randomly walk graph, try to get each peer X connections */
+    case GNUNET_TESTING_TOPOLOGY_OPTION_DFS: 
       perform_dfs(pg, (int)option_modifier);
       break;
     case GNUNET_TESTING_TOPOLOGY_OPTION_NONE:
-      /* Fall through */
+      break;
     case GNUNET_TESTING_TOPOLOGY_OPTION_ALL:
-      /* Fall through */
+      break;
     default:
       break;
     }
index 01c09092f0bf1ed23a87eb1a602190e256f16a83..5de55cd48a0243a42e13eaca65c6f0df0f6acb19 100644 (file)
@@ -355,7 +355,7 @@ accessHandlerCallback (void *cls,
       response = MHD_create_response_from_data (strlen (HTTP_ERROR_RESPONSE),HTTP_ERROR_RESPONSE, MHD_NO, MHD_NO);
       res = MHD_queue_response (session, MHD_HTTP_NOT_FOUND, response);
       MHD_destroy_response (response);
-      return MHD_YES;
+      return res;
     }
     conn_info = MHD_get_connection_info(session, MHD_CONNECTION_INFO_CLIENT_ADDRESS );
     /* Incoming IPv4 connection */