gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r447 - in GNUnet: . m4 src/applications/fs/ecrs src/applica


From: grothoff
Subject: [GNUnet-SVN] r447 - in GNUnet: . m4 src/applications/fs/ecrs src/applications/fs/lib src/applications/fs/module src/applications/sqstore_sqlite src/include src/util
Date: Sat, 19 Mar 2005 14:36:58 -0800 (PST)

Author: grothoff
Date: 2005-03-19 14:36:56 -0800 (Sat, 19 Mar 2005)
New Revision: 447

Modified:
   GNUnet/m4/Makefile.in
   GNUnet/src/applications/fs/ecrs/ecrs.h
   GNUnet/src/applications/fs/ecrs/keyspace.c
   GNUnet/src/applications/fs/ecrs/meta.c
   GNUnet/src/applications/fs/ecrs/search.c
   GNUnet/src/applications/fs/ecrs/searchtest.c
   GNUnet/src/applications/fs/ecrs/unindex.c
   GNUnet/src/applications/fs/lib/fslib.c
   GNUnet/src/applications/fs/module/fs.c
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
   GNUnet/src/include/gnunet_fs_lib.h
   GNUnet/src/include/gnunet_util.h
   GNUnet/src/util/logging.c
   GNUnet/todo
Log:
finally fixing big bad ecrs bug

Modified: GNUnet/m4/Makefile.in
===================================================================
--- GNUnet/m4/Makefile.in       2005-03-19 17:22:31 UTC (rev 446)
+++ GNUnet/m4/Makefile.in       2005-03-19 22:36:56 UTC (rev 447)
@@ -38,12 +38,12 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/guile.m4 $(top_srcdir)/m4/iconv.m4 \
-       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
-       $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libgcrypt.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/gtk-2.0.m4 $(top_srcdir)/m4/guile.m4 \
+       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libgcrypt.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -90,11 +90,15 @@
 F77 = @F77@
 FFLAGS = @FFLAGS@
 GMSGFMT = @GMSGFMT@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 GUILE = @GUILE@
 GUILE_CONFIG = @GUILE_CONFIG@
 GUILE_TOOLS = @GUILE_TOOLS@
 HAVE_CURSES_FALSE = @HAVE_CURSES_FALSE@
 HAVE_CURSES_TRUE = @HAVE_CURSES_TRUE@
+HAVE_GTK_FALSE = @HAVE_GTK_FALSE@
+HAVE_GTK_TRUE = @HAVE_GTK_TRUE@
 HAVE_GUILE_FALSE = @HAVE_GUILE_FALSE@
 HAVE_GUILE_TRUE = @HAVE_GUILE_TRUE@
 HAVE_IPV6_FALSE = @HAVE_IPV6_FALSE@
@@ -145,6 +149,7 @@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
 POSUB = @POSUB@
 RANLIB = @RANLIB@
 SET_MAKE = @SET_MAKE@

Modified: GNUnet/src/applications/fs/ecrs/ecrs.h
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrs.h      2005-03-19 17:22:31 UTC (rev 
446)
+++ GNUnet/src/applications/fs/ecrs/ecrs.h      2005-03-19 22:36:56 UTC (rev 
447)
@@ -31,7 +31,9 @@
 #include "tree.h"
 #include <extractor.h>
 
+#define EXTRA_CHECKS YES
 
+
 /**
  * Fixed SBlock updateInterval codes. Positive values 
  * are interpreted as durations (in seconds) for periodical 

Modified: GNUnet/src/applications/fs/ecrs/keyspace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/keyspace.c  2005-03-19 17:22:31 UTC (rev 
446)
+++ GNUnet/src/applications/fs/ecrs/keyspace.c  2005-03-19 22:36:56 UTC (rev 
447)
@@ -38,8 +38,74 @@
  */
 #define MAX_KBLOCK_SIZE 32000
 
+#if EXTRA_CHECKS
 
 /**
+ * Process replies received in response to our
+ * queries.  Verifies, decrypts and passes valid
+ * replies to the callback.
+ *
+ * @return SYSERR if the entry is malformed
+ */
+static int verifyKBlock(const HashCode512 * key,
+                       Datastore_Value * value) {
+  unsigned int type;
+  ECRS_FileInfo fi;
+  unsigned int size;
+  HashCode512 query;
+  KBlock * kb;
+  const char * dstURI;
+  EncName enc;
+  int j;
+
+  type = ntohl(value->type);
+  size = ntohl(value->size) - sizeof(Datastore_Value);
+  if (OK != getQueryFor(size,
+                       (DBlock*) &value[1],
+                       &query))
+    return SYSERR;
+  GNUNET_ASSERT(type == K_BLOCK);
+
+  if (size < sizeof(KBlock))
+    return SYSERR;
+  kb = (KBlock*) &value[1];
+  IFLOG(LOG_DEBUG,
+       hash2enc(key,
+                &enc));
+  ECRS_decryptInPlace(key,
+                     &kb[1],
+                     size - sizeof(KBlock));  
+  j = sizeof(KBlock);
+  while ( (j < size) &&
+         (((const char*)kb)[j] != '\0') )
+    j++;
+  if (j == size) {
+    BREAK(); /* kblock malformed */
+    return SYSERR;
+  }
+  dstURI = (const char*) &kb[1];
+  j++;
+  if (OK != ECRS_deserializeMetaData(&fi.meta,
+                                    &((char*)kb)[j],
+                                    size - j)) {
+    BREAK(); /* kblock malformed */
+    return SYSERR;
+  }
+  fi.uri = ECRS_stringToUri(dstURI);
+  if (fi.uri == NULL) {
+    BREAK(); /* kblock malformed */
+    ECRS_freeMetaData(fi.meta);
+    return SYSERR;
+  }
+  ECRS_freeUri(fi.uri);
+  ECRS_freeMetaData(fi.meta);
+  return OK;      
+}
+
+#endif
+
+
+/**
  * Add an entry into the K-space (keyword space).
  *
  * @param uri what is the URI under which the entry
@@ -67,6 +133,8 @@
   unsigned int keywordCount;
   int i;
   EncName enc;
+  HashCode512 key;
+  char * cpy; /* copy of the encrypted portion */
 
   if (! ECRS_isKeywordURI(uri)) {
     BREAK();
@@ -104,10 +172,11 @@
     memcpy(&kb[1],
           dstURI,
           strlen(dstURI)+1);
-    ECRS_serializeMetaData(md,
-                          &((char*)&kb[1])[strlen(dstURI)+1],
-                          mdsize,
-                          NO);
+    GNUNET_ASSERT(mdsize ==
+                 ECRS_serializeMetaData(md,
+                                        &((char*)&kb[1])[strlen(dstURI)+1],
+                                        mdsize,
+                                        NO));
   }  
   value->size = htonl(sizeof(Datastore_Value) + size);
   value->type = htonl(K_BLOCK);
@@ -119,35 +188,43 @@
   
   keywords = uri->data.ksk.keywords;
   keywordCount = uri->data.ksk.keywordCount;
+  cpy = MALLOC(mdsize + strlen(dstURI) + 1);
+  memcpy(cpy, &kb[1], mdsize + strlen(dstURI) + 1);
   for (i=0;i<keywordCount;i++) {
+    memcpy(&kb[1], cpy, mdsize + strlen(dstURI) + 1);
     hash(keywords[i],
         strlen(keywords[i]),
-        &hc);
+        &key);
     IFLOG(LOG_DEBUG,
-         hash2enc(&hc,
+         hash2enc(&key,
                   &enc));
     LOG(LOG_DEBUG,
        "Encrypting KBlock with key %s.\n",
        &enc);
-    ECRS_encryptInPlace(&hc,
+    ECRS_encryptInPlace(&key,
                        &kb[1],
                        mdsize + strlen(dstURI) + 1);
-    pk = makeKblockKey(&hc);
+    pk = makeKblockKey(&key);
     getPublicKey(pk,
                 &kb->keyspace);
     GNUNET_ASSERT(OK == sign(pk,
                             mdsize + strlen(dstURI) + 1,
                             &kb[1],
                             &kb->signature));
+#if EXTRA_CHECKS
     /* extra check: verify sig */
     GNUNET_ASSERT(OK == getQueryFor(size,
                                    (DBlock*) kb,
                                    &hc));
+#endif
     freePrivateKey(pk);
     if (OK != FS_insert(sock, value))
       ret = SYSERR;
+#if EXTRA_CHECKS
+    GNUNET_ASSERT(OK == verifyKBlock(&key, value))
+#endif
   }
-
+  FREE(cpy);
   FREE(dstURI);
   releaseClientSocket(sock);
   FREE(value);

Modified: GNUnet/src/applications/fs/ecrs/meta.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/meta.c      2005-03-19 17:22:31 UTC (rev 
446)
+++ GNUnet/src/applications/fs/ecrs/meta.c      2005-03-19 22:36:56 UTC (rev 
447)
@@ -424,6 +424,17 @@
         hdr,
         size);
   FREE(hdr);
+  /* extra check: deserialize! */
+#if EXTRA_CHECKS
+  {
+    MetaData * md;
+    md = NULL;
+    GNUNET_ASSERT(OK == ECRS_deserializeMetaData(&md,
+                                                target,
+                                                size));
+    ECRS_freeMetaData(md);    
+  }
+#endif
   return size;
 }
 

Modified: GNUnet/src/applications/fs/ecrs/search.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/search.c    2005-03-19 17:22:31 UTC (rev 
446)
+++ GNUnet/src/applications/fs/ecrs/search.c    2005-03-19 22:36:56 UTC (rev 
447)
@@ -339,14 +339,15 @@
                                   ps->keys)) ) {
       switch (type) {
       case K_BLOCK: {
-       const KBlock * kb;
+       KBlock * kb;
        const char * dstURI;
        EncName enc;
        int j;
        
        if (size < sizeof(KBlock))
          return SYSERR;
-       kb = (const KBlock*) &value[1];
+       kb = MALLOC(size);
+       memcpy(kb, &value[1], size);
        IFLOG(LOG_DEBUG,
              hash2enc(&ps->decryptKey,
                       &enc));
@@ -362,6 +363,7 @@
          j++;
        if (j == size) {
          BREAK(); /* kblock malformed */
+         FREE(kb);
          return SYSERR;
        }
        dstURI = (const char*) &kb[1];
@@ -370,12 +372,14 @@
                                           &((char*)kb)[j],
                                           size - j)) {
          BREAK(); /* kblock malformed */
+         FREE(kb);
          return SYSERR;
        }
        fi.uri = ECRS_stringToUri(dstURI);
        if (fi.uri == NULL) {
          BREAK(); /* kblock malformed */
          ECRS_freeMetaData(fi.meta);
+         FREE(kb);
          return SYSERR;
        }
        if (sqc->spcb != NULL) {
@@ -388,6 +392,7 @@
          ret = OK;
        ECRS_freeUri(fi.uri);
        ECRS_freeMetaData(fi.meta);
+       FREE(kb);
        return ret;      
       }
       case N_BLOCK: {
@@ -402,21 +407,25 @@
                             sqc);
       }
       case KN_BLOCK:  {
-       const KNBlock * kb;
+       KNBlock * kb;
+       int ret;
        
        if (size < sizeof(KNBlock))
          return SYSERR;
-       kb = (const KNBlock*) &value[1];
+       kb = MALLOC(size);
+       memcpy(kb, &value[1], size);
        ECRS_decryptInPlace(&ps->decryptKey,
                            &kb->nblock,
                            size - sizeof(KBlock));
-       return processNBlock(&kb->nblock,
-                            &ps->decryptKey,
-                            size - sizeof(KNBlock) + sizeof(NBlock),
-                            sqc);
+       ret = processNBlock(&kb->nblock,
+                           &ps->decryptKey,
+                           size - sizeof(KNBlock) + sizeof(NBlock),
+                           sqc);
+       FREE(kb);
+       return ret;
       }
       case S_BLOCK: {
-       const SBlock * sb;
+       SBlock * sb;
        const char * dstURI;
        int j;
        cron_t now;
@@ -425,7 +434,8 @@
        
        if (size < sizeof(SBlock))
          return SYSERR;
-       sb = (const SBlock*) &value[1];
+       sb = MALLOC(size);
+       memcpy(sb, &value[1], size);
        ECRS_decryptInPlace(&ps->decryptKey,
                            &sb->creationTime,
                            size
@@ -438,6 +448,7 @@
          j++;
        if (j == size) {
          BREAK(); /* sblock malformed */
+         FREE(sb);
          return SYSERR;
        }
        dstURI = (const char*) &sb[1];
@@ -446,12 +457,14 @@
                                           &dstURI[j],
                                           size - j)) {
          BREAK(); /* kblock malformed */
+         FREE(sb);
          return SYSERR;
        }
        fi.uri = ECRS_stringToUri(dstURI);
        if (fi.uri == NULL) {
          BREAK(); /* sblock malformed */
          ECRS_freeMetaData(fi.meta);
+         FREE(sb);
          return SYSERR;
        }
        if (sqc->spcb != NULL) {
@@ -466,13 +479,18 @@
        /* compute current/NEXT URI (if updateable SBlock) and issue
           respective query automatically! */
        cronTime(&now); 
-       if (OK != computeIdAtTime(sb, now, &updateId))
+       if (OK != computeIdAtTime(sb, now, &updateId)) {
+         FREE(sb);
          return SYSERR;
+       }
        if (equalsHashCode512(&updateId,
-                             &ps->decryptKey))
+                             &ps->decryptKey)) {
+         FREE(sb);
          return ret; /* have latest version */
+       }
        if (ps->keyCount != 2) {
          BREAK();
+         FREE(sb);
          return SYSERR;
        }
 
@@ -481,6 +499,7 @@
        updateURI.data.sks.identifier = updateId;
        addQueryForURI(&updateURI,
                       sqc);
+       FREE(sb);
        return ret;
       }
       default:

Modified: GNUnet/src/applications/fs/ecrs/searchtest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/searchtest.c        2005-03-19 17:22:31 UTC 
(rev 446)
+++ GNUnet/src/applications/fs/ecrs/searchtest.c        2005-03-19 22:36:56 UTC 
(rev 447)
@@ -42,7 +42,7 @@
                                     NULL));
   FREENONNULL(setConfigurationString("GNUNET",
                                     "LOGLEVEL",
-                                    "DEBUG"));
+                                    "NOTHING"));
   return OK;
 }
 
@@ -54,12 +54,14 @@
                    const HashCode512 * key,
                    void * closure) {
   int * cnt = closure;
+#if 0
   char * st;
 
   st = ECRS_uriToString(fi->uri);
   printf("Got result '%s'\n",
         st);
   FREE(st);
+#endif
   (*cnt)--;
   if (0 == *cnt)
     return SYSERR; /* abort search */
@@ -80,7 +82,7 @@
              &resultCount,
              &testTerminate,
              NULL);
-  if (resultCount == 0)
+  if (resultCount <= 0)
     return OK;
   else 
     return SYSERR;
@@ -96,7 +98,7 @@
   struct ECRS_URI * key;
   const char * keywords[6];
 
-  daemon = -1; // fork();
+  daemon = fork();
   if (daemon == 0) {
     if (0 != execlp("gnunetd", /* what binary to execute, must be in $PATH! */
                    "gnunetd", /* arg0, path to gnunet binary */
@@ -119,37 +121,10 @@
   CHECK(sock != NULL);
   
   /* ACTUAL TEST CODE */
-#if 1
-
-
   /* first, simple insertion => one result */
-  /* inserting another URI under the 'XXtest' keyword and under 'binary'
-     should give both URIs since ECRS knows nothing about 'AND'ing: */
-  printf("Testing search for 'binary' with one result.\n");
-  uri = 
ECRS_stringToUri("gnunet://ecrs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test-different");
-  meta = ECRS_createMetaData();
-  keywords[0] = "binary";
-  keywords[1] = NULL;
-  key = ECRS_keywordsToUri(keywords);
-  CHECK(OK == ECRS_addToKeyspace(key,
-                                0,
-                                0,
-                                cronTime(NULL) + 10 * cronMINUTES, /* expire */
-                                uri,
-                                meta));
-  CHECK(OK == searchFile(key,
-                        1));
-  ECRS_freeUri(key);
-  ECRS_freeUri(uri);
-  ECRS_freeMetaData(meta);
-
-
-#else
-
-
-
-  /* first, simple insertion => one result */
+#if 0
   printf("Testing search for 'XXtest' with one result.\n");
+#endif
   uri = 
ECRS_stringToUri("gnunet://ecrs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test");
   meta = ECRS_createMetaData();
   keywords[0] = "XXtest";
@@ -169,7 +144,9 @@
 
   /* inserting another URI under the 'XXtest' keyword and under 'binary'
      should give both URIs since ECRS knows nothing about 'AND'ing: */
+#if 0
   printf("Testing search for 'XXtest AND binary' with two results.\n");
+#endif
   uri = 
ECRS_stringToUri("gnunet://ecrs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test-different");
   keywords[1] = "binary";
   keywords[2] = NULL;
@@ -187,14 +164,14 @@
   ECRS_freeMetaData(meta);
 
   /* now searching just for 'XXtest' should again give 2 results! */
+#if 0
   printf("Testing search for 'XXtest' with two results.\n");
+#endif
   keywords[1] = NULL;
   key = ECRS_keywordsToUri(keywords);
   CHECK(OK == searchFile(key,
                         2));
   ECRS_freeUri(key);
-  
-#endif
 
   /* END OF TEST CODE */
  FAILURE:
@@ -214,7 +191,10 @@
     else
       return 1;    
   } else {
-    return 0;
+    if (ok == YES)
+      return 0;
+    else
+      return 1;
   }
 }
 

Modified: GNUnet/src/applications/fs/ecrs/unindex.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/unindex.c   2005-03-19 17:22:31 UTC (rev 
446)
+++ GNUnet/src/applications/fs/ecrs/unindex.c   2005-03-19 22:36:56 UTC (rev 
447)
@@ -122,12 +122,11 @@
   char * serverDir;
   char * serverFN;
   char * tmpName;
-  HashCode512 serverFileId;
   struct stat buf;
-  int ret;
 
 #ifndef S_ISLNK
-  return OK; /* symlinks do not exist? */
+  if (1)
+    return OK; /* symlinks do not exist? */
 #endif
   if (0 != LSTAT(fn,
                 &buf)) {

Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c      2005-03-19 17:22:31 UTC (rev 
446)
+++ GNUnet/src/applications/fs/lib/fslib.c      2005-03-19 22:36:56 UTC (rev 
447)
@@ -296,8 +296,8 @@
  * Initialize to index a file
  */
 int FS_initIndex(GNUNET_TCP_SOCKET * sock,
-       const HashCode512 * fileHc,
-       const char *fn) {
+                const HashCode512 * fileHc,
+                const char * fn) {
   int ret;
   RequestInitIndex *ri;
   unsigned int size, fnSize;

Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c      2005-03-19 17:22:31 UTC (rev 
446)
+++ GNUnet/src/applications/fs/module/fs.c      2005-03-19 22:36:56 UTC (rev 
447)
@@ -368,7 +368,7 @@
  * Process a request to symlink a file
  */
 static int csHandleRequestInitIndex(ClientHandle sock,
-        const CS_HEADER * req) {
+                                   const CS_HEADER * req) {
   int ret;
   char *fn;
   RequestInitIndex *ri;

Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2005-03-19 17:22:31 UTC 
(rev 446)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2005-03-19 22:36:56 UTC 
(rev 447)
@@ -165,6 +165,7 @@
  */
 static Datastore_Datum * assembleDatum(sqlite3_stmt *stmt) {
   Datastore_Datum * datum;
+  Datastore_Value * value;
   int contentSize;
     
   contentSize = sqlite3_column_int(stmt, 0) - sizeof(Datastore_Value);
@@ -182,17 +183,18 @@
   }
 
   datum = MALLOC(sizeof(Datastore_Datum) + contentSize);
-  datum->value.size = htonl(contentSize + sizeof(Datastore_Value));
-  datum->value.type = htonl(sqlite3_column_int(stmt, 1));
-  datum->value.prio = htonl(sqlite3_column_int(stmt, 2));
-  datum->value.anonymityLevel = htonl(sqlite3_column_int(stmt, 3));
-  datum->value.expirationTime = htonll(sqlite3_column_int64(stmt, 4));
+  value = &datum->value;
+  value->size = htonl(contentSize + sizeof(Datastore_Value));
+  value->type = htonl(sqlite3_column_int(stmt, 1));
+  value->prio = htonl(sqlite3_column_int(stmt, 2));
+  value->anonymityLevel = htonl(sqlite3_column_int(stmt, 3));
+  value->expirationTime = htonll(sqlite3_column_int64(stmt, 4));
   
   if (sqlite_decode_binary_n(sqlite3_column_blob(stmt, 5),
                             (char *) &datum->key,
                             sizeof(HashCode512)) != sizeof(HashCode512) ||
       sqlite_decode_binary_n(sqlite3_column_blob(stmt, 6), 
-                            (char *) &datum[1], 
+                            (char *) &value[1], 
                             contentSize) != contentSize) {
     
     LOG(LOG_WARNING,
@@ -657,6 +659,7 @@
     BREAK();
     return SYSERR;
   }
+
 #if DEBUG_SQLITE
   LOG(LOG_DEBUG,
       "Storing in database block with type %u.\n",

Modified: GNUnet/src/include/gnunet_fs_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fs_lib.h  2005-03-19 17:22:31 UTC (rev 446)
+++ GNUnet/src/include/gnunet_fs_lib.h  2005-03-19 22:36:56 UTC (rev 447)
@@ -85,7 +85,15 @@
 int FS_insert(GNUNET_TCP_SOCKET * sock,
              const Datastore_Value * block);
 
+
 /**
+ * Initialize to index a file.  Tries to do the symlinking.
+ */
+int FS_initIndex(GNUNET_TCP_SOCKET * sock,
+                const HashCode512 * fileHc,
+                const char * fn);
+
+/**
  * Index a block.  Note that while the API is VERY similar to
  * FS_insert in terms of signature, the block for FS_index must be in
  * plaintext, whereas the block passed to FS_insert must be encrypted!

Modified: GNUnet/src/include/gnunet_util.h
===================================================================
--- GNUnet/src/include/gnunet_util.h    2005-03-19 17:22:31 UTC (rev 446)
+++ GNUnet/src/include/gnunet_util.h    2005-03-19 22:36:56 UTC (rev 447)
@@ -916,6 +916,9 @@
    right loglevel */
 #define IFLOG(a,b) {if (getLogLevel() >= a) {b;} }
 
+void LOGHASH(size_t size,
+            const void * data);
+
 #define PRIP(ip) (unsigned int)(((unsigned int)(ip))>>24), (unsigned 
int)((((unsigned)(ip)))>>16 & 255), (unsigned int)((((unsigned int)(ip)))>>8 & 
255), (unsigned int)((((unsigned int)(ip))) & 255)
 
 /**

Modified: GNUnet/src/util/logging.c
===================================================================
--- GNUnet/src/util/logging.c   2005-03-19 17:22:31 UTC (rev 446)
+++ GNUnet/src/util/logging.c   2005-03-19 22:36:56 UTC (rev 447)
@@ -464,6 +464,20 @@
   exit(-1); /* just in case... */
 }
 
+void LOGHASH(size_t size,
+            const void * data) {
+  HashCode512 hc;
+  EncName enc;
+  hash(data, size, &hc);
+  hash2enc(&hc, &enc);
+  LOG(LOG_DEBUG,
+      "%u: %s\n",
+      size,
+      &enc);
+}
+
+
+
 int SNPRINTF(char * buf,
             size_t size,
             const char * format,

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2005-03-19 17:22:31 UTC (rev 446)
+++ GNUnet/todo 2005-03-19 22:36:56 UTC (rev 447)
@@ -9,7 +9,6 @@
 - uni-peer testing:
   * sqlite: test concurrency with iterators
   * gnunet-pseudonym
-  * gnunet-search: multiple search results don't work? Fix searchtest!
 - multi-peer testing: (see sessiontest.c and tbenchtest.c for templates)
   * gap
   * dht / gnunet-dht-join and gnunet-dht-query 





reply via email to

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