gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r8023 - GNUnet/src/applications/dht/tools


From: gnunet
Subject: [GNUnet-SVN] r8023 - GNUnet/src/applications/dht/tools
Date: Fri, 26 Dec 2008 23:17:40 -0700 (MST)

Author: grothoff
Date: 2008-12-26 23:17:40 -0700 (Fri, 26 Dec 2008)
New Revision: 8023

Modified:
   GNUnet/src/applications/dht/tools/dht_api.c
   GNUnet/src/applications/dht/tools/dht_loopback_test.c
   GNUnet/src/applications/dht/tools/dht_multipeer_test.c
   GNUnet/src/applications/dht/tools/dht_twopeer_test.c
Log:
minor bugfixes

Modified: GNUnet/src/applications/dht/tools/dht_api.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_api.c 2008-12-27 06:08:33 UTC (rev 
8022)
+++ GNUnet/src/applications/dht/tools/dht_api.c 2008-12-27 06:17:40 UTC (rev 
8023)
@@ -254,6 +254,7 @@
   GNUNET_mutex_unlock(ctx->lock);
   if (GNUNET_OK != GNUNET_client_connection_write (ctx->sock, &creq.header))
     ctx->restart = GNUNET_YES;
+  GNUNET_free(req);
   return GNUNET_OK;
 }
 

Modified: GNUnet/src/applications/dht/tools/dht_loopback_test.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_loopback_test.c       2008-12-27 
06:08:33 UTC (rev 8022)
+++ GNUnet/src/applications/dht/tools/dht_loopback_test.c       2008-12-27 
06:17:40 UTC (rev 8023)
@@ -154,6 +154,7 @@
 #if START_PEERS
   GNUNET_TESTING_stop_daemons (peers);
 #endif
+  GNUNET_free (value);
   GNUNET_GC_free (cfg);
   return ret;
 }

Modified: GNUnet/src/applications/dht/tools/dht_multipeer_test.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_multipeer_test.c      2008-12-27 
06:08:33 UTC (rev 8022)
+++ GNUnet/src/applications/dht/tools/dht_multipeer_test.c      2008-12-27 
06:17:40 UTC (rev 8023)
@@ -97,7 +97,7 @@
   struct GNUNET_TESTING_DaemonContext *peers;
   int ret = 0;
   GNUNET_HashCode key;
-  char *value;
+  char value[8];
   struct GNUNET_GE_Context *ectx;
   struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_ClientServerConnection *sock;
@@ -193,14 +193,12 @@
              return -1;
            }
          GNUNET_hash (buf, strlen (buf), &key);
-         value = GNUNET_malloc (8);
-         memset (value, 'A' + i, 8);
+         memset (value, 'A' + i, sizeof(value));
          CHECK (GNUNET_OK == GNUNET_DHT_put (cfg,
                                              ectx,
                                              &key,
                                              
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
-                                             8, value));
-         GNUNET_free (value);
+                                             sizeof(value), value));
        }
       printf("\n");
       /* get loop */

Modified: GNUnet/src/applications/dht/tools/dht_twopeer_test.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_twopeer_test.c        2008-12-27 
06:08:33 UTC (rev 8022)
+++ GNUnet/src/applications/dht/tools/dht_twopeer_test.c        2008-12-27 
06:17:40 UTC (rev 8023)
@@ -106,7 +106,7 @@
 #endif
   int ret = 0;
   GNUNET_HashCode key;
-  char *value;
+  char value[8];
   struct GNUNET_GE_Context *ectx;
   struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_DHT_Context *ctx_peer1;
@@ -212,13 +212,12 @@
                                             "NETWORK", "HOST",
                                             "localhost:2087");
   GNUNET_hash ("key 1", 5, &key);
-  value = GNUNET_malloc (8);
-  memset (value, 'A', 8);
+  memset (value, 'A', sizeof(value));
   CHECK (GNUNET_OK == GNUNET_DHT_put (cfg,
                                       ectx,
                                       &key,
                                       GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
-                                      8, value));
+                                      sizeof(value), value));
   GNUNET_hash ("key 2", 5, &key);
   value = GNUNET_malloc (8);
   memset (value, 'B', 8);
@@ -226,7 +225,7 @@
                                       ectx,
                                       &key,
                                       GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
-                                      8, value));
+                                      sizeof(value), value));
   GNUNET_hash ("key 1", 5, &key);
   peer2count = 10;
   printf ("Getting key 1 from peer 2 (stored at peer 1)");





reply via email to

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