gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r305 - in GNUnet/src: applications/fs/ecrs server


From: grothoff
Subject: [GNUnet-SVN] r305 - in GNUnet/src: applications/fs/ecrs server
Date: Fri, 25 Feb 2005 01:49:31 -0800 (PST)

Author: grothoff
Date: 2005-02-25 01:49:29 -0800 (Fri, 25 Feb 2005)
New Revision: 305

Modified:
   GNUnet/src/applications/fs/ecrs/check.conf
   GNUnet/src/applications/fs/ecrs/ecrstest.c
   GNUnet/src/applications/fs/ecrs/unindex.c
   GNUnet/src/server/tcpserver.c
Log:
fixes

Modified: GNUnet/src/applications/fs/ecrs/check.conf
===================================================================
--- GNUnet/src/applications/fs/ecrs/check.conf  2005-02-25 06:56:12 UTC (rev 
304)
+++ GNUnet/src/applications/fs/ecrs/check.conf  2005-02-25 09:49:29 UTC (rev 
305)
@@ -4,7 +4,7 @@
 GNUNETD_HOME     = /tmp/gnunet-check-ecrs
 
 [GNUNETD]
-VALGRIND        = 300
+# VALGRIND        = 300
 HELOEXPIRES     = 60
 LOGLEVEL        = NOTHING
 LOGFILE         = $GNUNETD_HOME/logs

Modified: GNUnet/src/applications/fs/ecrs/ecrstest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrstest.c  2005-02-25 06:56:12 UTC (rev 
304)
+++ GNUnet/src/applications/fs/ecrs/ecrstest.c  2005-02-25 09:49:29 UTC (rev 
305)
@@ -22,7 +22,7 @@
                                     NULL));
   FREENONNULL(setConfigurationString("GNUNET",
                                     "LOGLEVEL",
-                                    "WARNING"));
+                                    "DEBUG"));
   return OK;
 }
 
@@ -113,8 +113,12 @@
                    const HashCode160 * key,
                    void * closure) {
   struct ECRS_URI ** my = closure;
-
-  GNUNET_ASSERT(NULL == *my);
+  
+  // GNUNET_ASSERT(NULL == *my);
+  if (NULL != *my) {
+    BREAK();
+    return SYSERR;
+  }
   *my = ECRS_dupUri(fi->uri);
   return SYSERR; /* abort search */
 }
@@ -128,13 +132,13 @@
   struct ECRS_URI * myURI;
 
   myURI = NULL;
-  ECRS_search(*uri,
-             0,
-             15 * cronSECONDS,
-             &searchCB,
-             &myURI,
-             &testTerminate,
-             NULL);
+  ret = ECRS_search(*uri,
+                   0,
+                   450 * cronSECONDS,
+                   &searchCB,
+                   &myURI,
+                   &testTerminate,
+                   NULL);
   ECRS_freeUri(*uri);
   *uri = myURI;
   if ( (ret != SYSERR) &&
@@ -196,7 +200,7 @@
   struct ECRS_URI * uri;
   int i;
 
-  daemon = fork();
+  daemon = -1; // fork();
   if (daemon == 0) {
     /* FIXME: would be nice to be able to tell
        gnunetd to use the check/debug DB and not
@@ -204,7 +208,7 @@
     if (0 != execlp("gnunetd", /* what binary to execute, must be in $PATH! */
                    "gnunetd", /* arg0, path to gnunet binary */
                    "-d",  /* do not daemonize so we can easily kill you */
-                   "-L", "NOTHING",
+                   "-L", "DEBUG",
                    "-c",
                    "check.conf", /* configuration file */
                    NULL)) {
@@ -246,16 +250,20 @@
   MUTEX_DESTROY(&lock);
   stopCron();
   doneUtil();
-  if (0 != kill(daemon, SIGTERM))
-    DIE_STRERROR("kill");
-  if (daemon != waitpid(daemon, &status, 0)) 
-    DIE_STRERROR("waitpid");
-  
-  if ( (WEXITSTATUS(status) == 0) && 
-       (ok == YES) )
+  if (daemon != -1) {
+    if (0 != kill(daemon, SIGTERM))
+      DIE_STRERROR("kill");
+    if (daemon != waitpid(daemon, &status, 0)) 
+      DIE_STRERROR("waitpid");
+    
+    if ( (WEXITSTATUS(status) == 0) && 
+        (ok == YES) )
+      return 0;
+    else
+      return 1;    
+  } else {
     return 0;
-  else
-    return 1;    
+  }
 }
 
 /* end of ecrstest.c */

Modified: GNUnet/src/applications/fs/ecrs/unindex.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/unindex.c   2005-02-25 06:56:12 UTC (rev 
304)
+++ GNUnet/src/applications/fs/ecrs/unindex.c   2005-02-25 09:49:29 UTC (rev 
305)
@@ -141,7 +141,7 @@
           &enc);
   strcat(serverFN,
         (char*)&enc);  
-  tmpName = MALLOC(strlen(serverFN + 5));
+  tmpName = MALLOC(strlen(serverFN) + 5);
   ret = readlink(fn,
                 tmpName,
                 strlen(serverFN) + 4);
@@ -298,7 +298,7 @@
   dblock->expirationTime = htonll(0);
   db = (DBlock*) &dblock[1];
   db->type = htonl(D_BLOCK);
-  iblocks = MALLOC(sizeof(Datastore_Value*) * treedepth);
+  iblocks = MALLOC(sizeof(Datastore_Value*) * (treedepth+1));
   for (i=0;i<=treedepth;i++) {
     iblocks[i] = MALLOC(sizeof(Datastore_Value) + IBLOCK_SIZE + 
sizeof(DBlock));
     iblocks[i]->size = htonl(sizeof(Datastore_Value) + sizeof(DBlock));

Modified: GNUnet/src/server/tcpserver.c
===================================================================
--- GNUnet/src/server/tcpserver.c       2005-02-25 06:56:12 UTC (rev 304)
+++ GNUnet/src/server/tcpserver.c       2005-02-25 09:49:29 UTC (rev 305)
@@ -361,9 +361,9 @@
                      handle);
   MUTEX_LOCK(&clientlock);
   /* finally, shrink buffer adequately */
-  memcpy(&handle->readBuffer[0],
-        &handle->readBuffer[len],
-        handle->readBufferPos - len);
+  memmove(&handle->readBuffer[0],
+         &handle->readBuffer[len],
+         handle->readBufferPos - len);
   handle->readBufferPos -= len;           
   return ret;
 }





reply via email to

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