gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11838 - in gnunet: . src/fs


From: gnunet
Subject: [GNUnet-SVN] r11838 - in gnunet: . src/fs
Date: Sun, 20 Jun 2010 17:28:57 +0200

Author: grothoff
Date: 2010-06-20 17:28:57 +0200 (Sun, 20 Jun 2010)
New Revision: 11838

Modified:
   gnunet/TODO
   gnunet/src/fs/fs_directory.c
   gnunet/src/fs/gnunet-service-fs.c
Log:
clean up

Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2010-06-20 15:13:57 UTC (rev 11837)
+++ gnunet/TODO 2010-06-20 15:28:57 UTC (rev 11838)
@@ -11,8 +11,6 @@
   - implement DV transport plugin
   - implement testcases 
   - implement performance tests (needs tbench)
-* TOPOLOGY:
-  - needs more testing (especially F2F topology) & transport blacklisting
 * UTIL:
   - only connect() sockets that are ready (select()) [Nils]
     [On W32, we need to select after calling socket before doing connect etc.]
@@ -33,6 +31,8 @@
     why is it so slow? Fix! (see core_api_reliability test)
   - implement API to get notifications about bandwidth assignments to 
individual peers
   - implement API to get notifications about updates to liveness of individual 
peers (before disconnect)
+* TOPOLOGY:
+  - needs more testing (especially F2F topology) & transport blacklisting
 * TBENCH: [MW]
   - good to have for transport/DV evaluation! 
 * DHT: [Nate]

Modified: gnunet/src/fs/fs_directory.c
===================================================================
--- gnunet/src/fs/fs_directory.c        2010-06-20 15:13:57 UTC (rev 11837)
+++ gnunet/src/fs/fs_directory.c        2010-06-20 15:28:57 UTC (rev 11838)
@@ -559,6 +559,7 @@
               badness = cbad;
             }
         }
+      GNUNET_assert (best >= 0);
       tmp = perm[i];
       perm[i] = perm[best];
       perm[best] = tmp;
@@ -597,7 +598,7 @@
   ssize_t ret;
   uint32_t big;
 
-  size = 8 + sizeof (uint32_t);
+  size = strlen (GNUNET_DIRECTORY_MAGIC) + sizeof (uint32_t);
   size += GNUNET_CONTAINER_meta_data_get_serialized_size (bld->meta);
   sizes = NULL;
   perm = NULL;
@@ -641,8 +642,8 @@
       return GNUNET_SYSERR;
     }
   *rdata = data;
-  memcpy (data, GNUNET_DIRECTORY_MAGIC, 8);
-  off = 8;
+  memcpy (data, GNUNET_DIRECTORY_MAGIC, strlen (GNUNET_DIRECTORY_MAGIC));
+  off = strlen (GNUNET_DIRECTORY_MAGIC);
 
   sptr = &data[off + sizeof (uint32_t)];
   ret = GNUNET_CONTAINER_meta_data_serialize (bld->meta,
@@ -651,7 +652,7 @@
                                              
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL);
   GNUNET_assert (ret != -1);
   big = htonl (ret);  
-  memcpy (&data[8], &big, sizeof (uint32_t));
+  memcpy (&data[off], &big, sizeof (uint32_t));
   off += sizeof (uint32_t) + ret;
   for (j = 0; j < bld->count; j++)
     {

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2010-06-20 15:13:57 UTC (rev 11837)
+++ gnunet/src/fs/gnunet-service-fs.c   2010-06-20 15:28:57 UTC (rev 11838)
@@ -3084,11 +3084,12 @@
   pr = GNUNET_malloc (sizeof (struct PendingRequest) + 
                      (have_ns ? sizeof(GNUNET_HashCode) : 0));
   if (have_ns)
-    pr->namespace = (GNUNET_HashCode*) &pr[1];
+    {
+      pr->namespace = (GNUNET_HashCode*) &pr[1];
+      memcpy (pr->namespace, &opt[bits++], sizeof (GNUNET_HashCode));
+    }
   pr->type = type;
   pr->mingle = ntohl (gm->filter_mutator);
-  if (0 != (bm & GET_MESSAGE_BIT_SKS_NAMESPACE))    
-    memcpy (&pr[1], &opt[bits++], sizeof (GNUNET_HashCode));
   if (0 != (bm & GET_MESSAGE_BIT_TRANSMIT_TO))
     pr->target_pid = GNUNET_PEER_intern ((const struct GNUNET_PeerIdentity*) 
&opt[bits++]);
 




reply via email to

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