gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6195 - GNUnet/src/applications/fs/gap


From: gnunet
Subject: [GNUnet-SVN] r6195 - GNUnet/src/applications/fs/gap
Date: Thu, 7 Feb 2008 22:38:37 -0700 (MST)

Author: grothoff
Date: 2008-02-07 22:38:37 -0700 (Thu, 07 Feb 2008)
New Revision: 6195

Modified:
   GNUnet/src/applications/fs/gap/fs.c
   GNUnet/src/applications/fs/gap/ondemand.c
Log:
fix

Modified: GNUnet/src/applications/fs/gap/fs.c
===================================================================
--- GNUnet/src/applications/fs/gap/fs.c 2008-02-08 05:23:31 UTC (rev 6194)
+++ GNUnet/src/applications/fs/gap/fs.c 2008-02-08 05:38:37 UTC (rev 6195)
@@ -288,11 +288,13 @@
                  type);
 #endif
   GNUNET_mutex_lock (GNUNET_FS_lock);
-  if (GNUNET_SYSERR ==
-      datastore->get (&query, type,
-                      &GNUNET_FS_HELPER_complete_value_from_database_callback,
-                      value))
-    {                           /* aborted == found! */
+  value->type = htonl(GNUNET_ECRS_BLOCKTYPE_ANY);
+  if ( (1 ==
+       datastore->get (&query, type,
+                       &GNUNET_FS_HELPER_complete_value_from_database_callback,
+                       value)) &&
+       (value->type != htonl(GNUNET_ECRS_BLOCKTYPE_ANY)) )
+    {
       ret = datastore->del (&query, value);
     }
   else

Modified: GNUnet/src/applications/fs/gap/ondemand.c
===================================================================
--- GNUnet/src/applications/fs/gap/ondemand.c   2008-02-08 05:23:31 UTC (rev 
6194)
+++ GNUnet/src/applications/fs/gap/ondemand.c   2008-02-08 05:38:37 UTC (rev 
6195)
@@ -551,7 +551,10 @@
       odb.fileId = *fileId;
       /* compute the primary key */
       GNUNET_EC_file_block_get_query (block, delta + sizeof (DBlock), &key);
-      if (GNUNET_SYSERR == datastore->get (&key, 
GNUNET_ECRS_BLOCKTYPE_ONDEMAND, 
&GNUNET_FS_HELPER_complete_value_from_database_callback, &odb.header)) /* 
aborted == found! */
+      if ( (1 == datastore->get (&key,
+                                GNUNET_ECRS_BLOCKTYPE_ONDEMAND,
+                                
&GNUNET_FS_HELPER_complete_value_from_database_callback, &odb.header)) &&
+          (odb.header.expirationTime != 0) )
         ret = datastore->del (&key, &odb.header);
       else                      /* not found */
         ret = GNUNET_SYSERR;





reply via email to

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