gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6259 - GNUnet/src/applications/fs/ecrs


From: gnunet
Subject: [GNUnet-SVN] r6259 - GNUnet/src/applications/fs/ecrs
Date: Mon, 11 Feb 2008 21:52:22 -0700 (MST)

Author: grothoff
Date: 2008-02-11 21:52:22 -0700 (Mon, 11 Feb 2008)
New Revision: 6259

Modified:
   GNUnet/src/applications/fs/ecrs/download.c
   GNUnet/src/applications/fs/ecrs/downloadtest.c
   GNUnet/src/applications/fs/ecrs/ecrstest.c
   GNUnet/src/applications/fs/ecrs/keyspace.c
   GNUnet/src/applications/fs/ecrs/meta.c
   GNUnet/src/applications/fs/ecrs/namespace.c
   GNUnet/src/applications/fs/ecrs/namespacetest.c
   GNUnet/src/applications/fs/ecrs/unindex.c
   GNUnet/src/applications/fs/ecrs/updowntest.c
   GNUnet/src/applications/fs/ecrs/upload.c
Log:
leaks

Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c  2008-02-12 04:51:41 UTC (rev 
6258)
+++ GNUnet/src/applications/fs/ecrs/download.c  2008-02-12 04:52:22 UTC (rev 
6259)
@@ -842,12 +842,12 @@
                                                  fn,
                                                  O_CREAT | O_RDWR,
                                                  S_IRUSR | S_IWUSR);
+          GNUNET_free (fn);
           if (rm.handles[i] < 0)
             {
               free_request_manager (&rm, GNUNET_NO);
               return GNUNET_SYSERR;
             }
-          GNUNET_free (fn);
         }
     }
   rm.lock = GNUNET_mutex_create (GNUNET_YES);
@@ -878,6 +878,7 @@
     GNUNET_free (top);
   GNUNET_mutex_unlock (rm.lock);
   while ((GNUNET_OK == tt (ttClosure)) &&
+         (GNUNET_YES != GNUNET_shutdown_test ()) &&
          (rm.abortFlag == GNUNET_NO) && (rm.head != NULL))
     GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);
   if ((rm.head == NULL) &&

Modified: GNUnet/src/applications/fs/ecrs/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/downloadtest.c      2008-02-12 04:51:41 UTC 
(rev 6258)
+++ GNUnet/src/applications/fs/ecrs/downloadtest.c      2008-02-12 04:52:22 UTC 
(rev 6259)
@@ -130,8 +130,7 @@
   for (i = 0; i < (int) (size - 42 - 2 * sizeof (GNUNET_HashCode));
        i += sizeof (GNUNET_HashCode))
     GNUNET_hash (&buf[i], 42,
-                (GNUNET_HashCode *) & buf[i +
-                                          sizeof (GNUNET_HashCode)]);
+                 (GNUNET_HashCode *) & buf[i + sizeof (GNUNET_HashCode)]);
   for (j = SIZE - 16 * 1024; j >= 0; j -= 16 * 1024)
     {
       fprintf (stderr, ".");
@@ -149,13 +148,13 @@
                                                           NULL))
         {
           fd = GNUNET_disk_file_open (NULL, tmpName, O_RDONLY);
-         if ( (size != READ (fd, in, size)) ||
-              (0 != memcmp (&buf[j], &in[j], 16 * 1024)) )
-           {
-             ret = GNUNET_SYSERR;
-             CLOSE (fd);
-             break;
-           }
+          if ((size != READ (fd, in, size)) ||
+              (0 != memcmp (&buf[j], &in[j], 16 * 1024)))
+            {
+              ret = GNUNET_SYSERR;
+              CLOSE (fd);
+              break;
+            }
           CLOSE (fd);
         }
     }

Modified: GNUnet/src/applications/fs/ecrs/ecrstest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrstest.c  2008-02-12 04:51:41 UTC (rev 
6258)
+++ GNUnet/src/applications/fs/ecrs/ecrstest.c  2008-02-12 04:52:22 UTC (rev 
6259)
@@ -40,9 +40,9 @@
 }
 
 static int
-testTerminateNC (void * ptr)
+testTerminateNC (void *ptr)
 {
-  void ** p = ptr;
+  void **p = ptr;
   if (NULL == (*p))
     return GNUNET_OK;
   return GNUNET_SYSERR;
@@ -50,7 +50,7 @@
 
 static struct GNUNET_GC_Configuration *cfg;
 
-static struct GNUNET_ECRS_URI * want;
+static struct GNUNET_ECRS_URI *want;
 
 static char *
 makeName (unsigned int i)
@@ -98,7 +98,7 @@
       struct GNUNET_ECRS_MetaData *meta;
       struct GNUNET_ECRS_URI *key;
       const char *keywords[2];
-      
+
       keywords[0] = name;
       keywords[1] = NULL;
 
@@ -133,8 +133,7 @@
   struct GNUNET_ECRS_URI **my = closure;
   char *tmp;
 
-  if (! GNUNET_ECRS_uri_test_equal(want,
-                                  fi->uri))
+  if (!GNUNET_ECRS_uri_test_equal (want, fi->uri))
     return GNUNET_OK;
   tmp = GNUNET_ECRS_uri_to_string (fi->uri);
   GNUNET_GE_LOG (NULL,
@@ -159,7 +158,8 @@
   myURI = NULL;
   ret = GNUNET_ECRS_search (NULL,
                             cfg,
-                            *uri, 0, &searchCB, &myURI, &testTerminateNC, 
&myURI);
+                            *uri, 0, &searchCB, &myURI, &testTerminateNC,
+                            &myURI);
   GNUNET_ECRS_uri_destroy (*uri);
   *uri = myURI;
   if ((ret != GNUNET_SYSERR) && (myURI != NULL))

Modified: GNUnet/src/applications/fs/ecrs/keyspace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/keyspace.c  2008-02-12 04:51:41 UTC (rev 
6258)
+++ GNUnet/src/applications/fs/ecrs/keyspace.c  2008-02-12 04:52:22 UTC (rev 
6259)
@@ -176,6 +176,7 @@
         {
           GNUNET_GE_BREAK (ectx, 0);
           GNUNET_free (dstURI);
+          GNUNET_free (value);
           return GNUNET_SYSERR;
         }
       size = sizeof (KBlock) + strlen (dstURI) + 1 + mdsize;

Modified: GNUnet/src/applications/fs/ecrs/meta.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/meta.c      2008-02-12 04:51:41 UTC (rev 
6258)
+++ GNUnet/src/applications/fs/ecrs/meta.c      2008-02-12 04:52:22 UTC (rev 
6259)
@@ -826,7 +826,7 @@
              (filename[i] != '.') && (filename[i] != DIR_SEPARATOR))
         i--;
       if (filename[i] == '.')
-        mime = GNUNET_strdup (&filename[i]);
+        mime = &filename[i];
     }
   if (mime == NULL)
     {

Modified: GNUnet/src/applications/fs/ecrs/namespace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespace.c 2008-02-12 04:51:41 UTC (rev 
6258)
+++ GNUnet/src/applications/fs/ecrs/namespace.c 2008-02-12 04:52:22 UTC (rev 
6259)
@@ -463,6 +463,7 @@
           GNUNET_GE_BREAK (ectx, 0);
           GNUNET_free (dstURI);
           GNUNET_RSA_free_key (hk);
+          GNUNET_free (value);
           return NULL;
         }
       size = sizeof (SBlock) + mdsize + strlen (dstURI) + 1;

Modified: GNUnet/src/applications/fs/ecrs/namespacetest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespacetest.c     2008-02-12 04:51:41 UTC 
(rev 6258)
+++ GNUnet/src/applications/fs/ecrs/namespacetest.c     2008-02-12 04:52:22 UTC 
(rev 6259)
@@ -54,7 +54,8 @@
   return GNUNET_OK;
 }
 
-static int tt(void * unused) 
+static int
+tt (void *unused)
 {
   if (match == 1)
     return GNUNET_SYSERR;

Modified: GNUnet/src/applications/fs/ecrs/unindex.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/unindex.c   2008-02-12 04:51:41 UTC (rev 
6258)
+++ GNUnet/src/applications/fs/ecrs/unindex.c   2008-02-12 04:52:22 UTC (rev 
6259)
@@ -226,7 +226,10 @@
 
   fd = GNUNET_disk_file_open (ectx, filename, O_RDONLY | O_LARGEFILE);
   if (fd == -1)
-    return GNUNET_SYSERR;
+    {
+      GNUNET_client_connection_destroy (sock);
+      return GNUNET_SYSERR;
+    }
   dblock =
     GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + DBLOCK_SIZE +
                    sizeof (DBlock));

Modified: GNUnet/src/applications/fs/ecrs/updowntest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/updowntest.c        2008-02-12 04:51:41 UTC 
(rev 6258)
+++ GNUnet/src/applications/fs/ecrs/updowntest.c        2008-02-12 04:52:22 UTC 
(rev 6259)
@@ -83,7 +83,7 @@
                                  GNUNET_get_time () + 10 * 
GNUNET_CRON_MINUTES, /* expire */
                                  NULL,  /* progress */
                                  NULL, &testTerminate, NULL, &uri);
-  GNUNET_free(name);
+  GNUNET_free (name);
   return uri;
 }
 
@@ -204,10 +204,10 @@
       fprintf (stderr, "Testing filesize %u ", filesizes[i]);
       uri = uploadFile (filesizes[i]);
       if (uri == NULL)
-       {
-         fprintf (stderr, "Error.\n");
-         CHECK(0);
-       }
+        {
+          fprintf (stderr, "Error.\n");
+          CHECK (0);
+        }
       CHECK (GNUNET_OK == downloadFile (filesizes[i], uri));
       GNUNET_ECRS_uri_destroy (uri);
       CHECK (GNUNET_OK == unindexFile (filesizes[i]));

Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c    2008-02-12 04:51:41 UTC (rev 
6258)
+++ GNUnet/src/applications/fs/ecrs/upload.c    2008-02-12 04:52:22 UTC (rev 
6259)
@@ -287,11 +287,11 @@
       GNUNET_EC_file_block_get_key (db, size + sizeof (DBlock), &mchk.key);
       GNUNET_EC_file_block_get_query (db, size + sizeof (DBlock),
                                       &mchk.query);
-#if DEBUG_UPLOAD 
+#if DEBUG_UPLOAD
       GNUNET_hash_to_enc (&mchk.query, &enc);
-      fprintf(stderr,
-             "Query for current block of size %u is `%s'\n", size,
-             (const char*) &enc);
+      fprintf (stderr,
+               "Query for current block of size %u is `%s'\n", size,
+               (const char *) &enc);
 #endif
       if (doIndex)
         {





reply via email to

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