gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17073 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r17073 - gnunet/src/dht
Date: Tue, 27 Sep 2011 22:39:19 +0200

Author: grothoff
Date: 2011-09-27 22:39:18 +0200 (Tue, 27 Sep 2011)
New Revision: 17073

Modified:
   gnunet/src/dht/Makefile.am
   gnunet/src/dht/gnunet-service-dht_neighbours.c
   gnunet/src/dht/test_dht_twopeer_get_put.c
   gnunet/src/dht/test_dht_twopeer_put_get.c
Log:
fixes

Modified: gnunet/src/dht/Makefile.am
===================================================================
--- gnunet/src/dht/Makefile.am  2011-09-27 20:23:01 UTC (rev 17072)
+++ gnunet/src/dht/Makefile.am  2011-09-27 20:39:18 UTC (rev 17073)
@@ -239,7 +239,7 @@
 test_dht_twopeer_get_put_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/testing/libgnunettesting.la \
- $(top_builddir)/src/dht/libgnunetdht.la   
+ $(top_builddir)/src/dht/libgnunetdhtnew.la   
 
 test_dht_twopeer_path_tracking_SOURCES = \
  test_dht_twopeer_path_tracking.c

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c      2011-09-27 20:23:01 UTC 
(rev 17072)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c      2011-09-27 20:39:18 UTC 
(rev 17073)
@@ -1288,7 +1288,7 @@
                                   desired_replication_level,
                                   &targets);
   if (0 == target_count)
-    return;  
+    return;
   reply_bf_size = GNUNET_CONTAINER_bloomfilter_get_size (reply_bf);
   msize = xquery_size + sizeof (struct PeerGetMessage) + reply_bf_size;
   if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
@@ -1843,22 +1843,20 @@
       GNUNET_break_op (0);
       return GNUNET_YES;
     }
-    if (0 == memcmp (&my_identity, &pid, sizeof (struct GNUNET_PeerIdentity)))
+    if (0 != memcmp (&my_identity, &pid, sizeof (struct GNUNET_PeerIdentity)))
     {
-      /* got my own HELLO */
-      return GNUNET_YES;
+      bucket = find_bucket (&pid.hashPubKey);
+      if ( (bucket >= 0) &&
+          (k_buckets[bucket].peers_size < bucket_size) )
+       {    
+         if (NULL != GDS_transport_handle)
+           GNUNET_TRANSPORT_offer_hello (GDS_transport_handle,
+                                         h, NULL, NULL);
+         (void) GNUNET_CORE_peer_request_connect (coreAPI,
+                                                  &pid, 
+                                                  NULL, NULL);
+       }   
     }
-    bucket = find_bucket (&pid.hashPubKey);
-    if ( (bucket >= 0) &&
-        (k_buckets[bucket].peers_size < bucket_size) )
-    {    
-      if (NULL != GDS_transport_handle)
-       GNUNET_TRANSPORT_offer_hello (GDS_transport_handle,
-                                     h, NULL, NULL);
-      (void) GNUNET_CORE_peer_request_connect (coreAPI,
-                                              &pid, 
-                                              NULL, NULL);
-    }   
   }
 
   /* append 'peer' to 'get_path' */

Modified: gnunet/src/dht/test_dht_twopeer_get_put.c
===================================================================
--- gnunet/src/dht/test_dht_twopeer_get_put.c   2011-09-27 20:23:01 UTC (rev 
17072)
+++ gnunet/src/dht/test_dht_twopeer_get_put.c   2011-09-27 20:39:18 UTC (rev 
17073)
@@ -39,7 +39,7 @@
 #include "platform.h"
 #include "gnunet_testing_lib.h"
 #include "gnunet_core_service.h"
-#include "gnunet_dht_service.h"
+#include "gnunet_dht_service_new.h"
 #include "block_dns.h"
 #include "gnunet_signatures.h"
 
@@ -215,8 +215,10 @@
 void
 get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
                      const GNUNET_HashCode * key,
-                     const struct GNUNET_PeerIdentity *const *get_path,
-                     const struct GNUNET_PeerIdentity *const *put_path,
+                     const struct GNUNET_PeerIdentity  *get_path,
+                    unsigned int get_path_size,
+                     const struct GNUNET_PeerIdentity  *put_path,
+                    unsigned int put_path_size,
                      enum GNUNET_BLOCK_Type type, size_t size,
                      const void *result_data)
 {
@@ -277,8 +279,8 @@
 #else
                             GNUNET_BLOCK_TYPE_TEST,
 #endif
-                            &key, DEFAULT_GET_REPLICATION, GNUNET_DHT_RO_NONE,
-                            NULL, 0, NULL, 0, &get_result_iterator, NULL);
+                            &key, 1, GNUNET_DHT_RO_NONE,
+                            NULL, 0, &get_result_iterator, NULL);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
                                 (GNUNET_TIME_UNIT_SECONDS, 10), &do_put, NULL);
 }
@@ -311,7 +313,7 @@
   memset (data, 43, sizeof (data));
 
   /* Insert the data at the first peer */
-  GNUNET_DHT_put (peer1dht, &key, DEFAULT_PUT_REPLICATION, GNUNET_DHT_RO_NONE,
+  GNUNET_DHT_put (peer1dht, &key, 1, GNUNET_DHT_RO_NONE,
                   GNUNET_BLOCK_TYPE_TEST, sizeof (data), data,
                   GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL,
                   &put_finished, NULL);

Modified: gnunet/src/dht/test_dht_twopeer_put_get.c
===================================================================
--- gnunet/src/dht/test_dht_twopeer_put_get.c   2011-09-27 20:23:01 UTC (rev 
17072)
+++ gnunet/src/dht/test_dht_twopeer_put_get.c   2011-09-27 20:39:18 UTC (rev 
17073)
@@ -44,7 +44,7 @@
 #include "gnunet_signatures.h"
 
 /* DEFINES */
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
 
 /* Timeout for entire testcase */
 #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5)
@@ -254,10 +254,10 @@
 
   memset (&key, 42, sizeof (GNUNET_HashCode));  /* Set the key to the same 
thing as when data was inserted */
   global_get_handle =
-      GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_relative_get_forever (),
-                            GNUNET_BLOCK_TYPE_TEST,
-                            &key, 1, GNUNET_DHT_RO_NONE,
-                            NULL, 0, &get_result_iterator, NULL);
+    GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_UNIT_FOREVER_REL,
+                         GNUNET_BLOCK_TYPE_TEST,
+                         &key, 1, GNUNET_DHT_RO_NONE,
+                         NULL, 0, &get_result_iterator, NULL);
 }
 
 




reply via email to

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