gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11441 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r11441 - gnunet/src/fs
Date: Wed, 19 May 2010 23:45:22 +0200

Author: grothoff
Date: 2010-05-19 23:45:22 +0200 (Wed, 19 May 2010)
New Revision: 11441

Modified:
   gnunet/src/fs/Makefile.am
   gnunet/src/fs/fs_test_lib.c
   gnunet/src/fs/fs_test_lib_data.conf
   gnunet/src/fs/gnunet-service-fs.c
   gnunet/src/fs/gnunet-service-fs_indexing.c
   gnunet/src/fs/test_fs_list_indexed_data.conf
   gnunet/src/fs/test_gnunet_service_fs_p2p.c
Log:
breaking FS big time, no idea why

Modified: gnunet/src/fs/Makefile.am
===================================================================
--- gnunet/src/fs/Makefile.am   2010-05-19 21:23:08 UTC (rev 11440)
+++ gnunet/src/fs/Makefile.am   2010-05-19 21:45:22 UTC (rev 11441)
@@ -143,7 +143,7 @@
  test_gnunet_fs_idx.py
 endif
 
-TESTS = $(check_SCRIPTS) \
+TESTS = \
  test_fs_directory \
  test_fs_download \
  test_fs_download_persistence \
@@ -159,7 +159,8 @@
  test_fs_unindex_persistence \
  test_fs_uri \
  test_fs_test_lib \
- test_gnunet_service_fs_p2p
+ test_gnunet_service_fs_p2p \
+ $(check_SCRIPTS) 
 # $(check_PROGRAMS)
 
 

Modified: gnunet/src/fs/fs_test_lib.c
===================================================================
--- gnunet/src/fs/fs_test_lib.c 2010-05-19 21:23:08 UTC (rev 11440)
+++ gnunet/src/fs/fs_test_lib.c 2010-05-19 21:45:22 UTC (rev 11441)
@@ -180,6 +180,7 @@
 {
   struct GNUNET_FS_TestDaemon *daemon = cls;
 
+  fprintf (stderr, "PCB %d\n", info->status);
   switch (info->status)
     {
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:      

Modified: gnunet/src/fs/fs_test_lib_data.conf
===================================================================
--- gnunet/src/fs/fs_test_lib_data.conf 2010-05-19 21:23:08 UTC (rev 11440)
+++ gnunet/src/fs/fs_test_lib_data.conf 2010-05-19 21:45:22 UTC (rev 11441)
@@ -22,7 +22,6 @@
 [datastore]
 #DEBUG = YES
 #PREFIX = valgrind --tool=memcheck --leak-check=yes
-#BINARY = /home/grothoff/bin/gnunet-service-datastore
 
 [statistics]
 PORT = 43467
@@ -31,7 +30,6 @@
 [transport-tcp]
 TIMEOUT = 300000
 #PORT = 43468
-#DEBUG = YES
 
 [peerinfo]
 PORT = 43469
@@ -51,10 +49,10 @@
 [fs]
 PORT = 43471
 HOSTNAME = localhost
-#OPTIONS = -L DEBUG
+OPTIONS = -L DEBUG
 #DEBUG = YES
-PREFIX = valgrind --tool=memcheck --leak-check=yes
-#BINARY = /home/grothoff/bin/gnunet-service-fs
+#PREFIX = valgrind --tool=memcheck --leak-check=yes
+BINARY = /home/grothoff/bin/gnunet-service-fs
 #PREFIX = xterm -e gdb -x cmd --args 
 
 [testing]

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2010-05-19 21:23:08 UTC (rev 11440)
+++ gnunet/src/fs/gnunet-service-fs.c   2010-05-19 21:45:22 UTC (rev 11441)
@@ -44,7 +44,7 @@
 #include "gnunet-service-fs_indexing.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_NO
+#define DEBUG_FS GNUNET_YES
 
 /**
  * Maximum number of outgoing messages we queue per peer.
@@ -936,6 +936,10 @@
        GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
       return;
     }
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Retrieved block `%s' of type %u for migration\n",
+             GNUNET_h2s (key),
+             type);
   mb = GNUNET_malloc (sizeof (struct MigrationReadyBlock) + size);
   mb->query = *key;
   mb->expiration = expiration;
@@ -1509,7 +1513,7 @@
                          &pid.hashPubKey,
                          cp);
     }
-#if DEBUG_FS
+#if DEBUG_FS > 3
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Transmitting %u bytes to peer %u\n",
              msize,
@@ -2260,6 +2264,11 @@
    * How much was this reply worth to us?
    */
   uint32_t priority;
+
+  /**
+   * Did we finish processing the associated request?
+   */ 
+  int finished;
 };
 
 
@@ -2420,7 +2429,7 @@
     }
   prq->priority += pr->remaining_priority;
   pr->remaining_priority = 0;
-  if (pr->client_request_list != NULL)
+  if (NULL != pr->client_request_list)
     {
       GNUNET_STATISTICS_update (stats,
                                gettext_noop ("# replies received for local 
clients"),
@@ -2456,7 +2465,10 @@
        }
       GNUNET_break (cl->th != NULL);
       if (pr->do_remove)               
-       destroy_pending_request (pr);           
+       {
+         prq->finished = GNUNET_YES;
+         destroy_pending_request (pr);         
+       }
     }
   else
     {
@@ -2583,12 +2595,19 @@
   prq.type = type;
   prq.expiration = expiration;
   prq.priority = 0;
+  prq.finished = GNUNET_NO;
   GNUNET_CONTAINER_multihashmap_get_multiple (query_request_map,
                                              &query,
                                              &process_reply,
                                              &prq);
   if (GNUNET_YES == active_migration)
     {
+#if DEBUG_FS
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Replicating result for query `%s' with priority %u\n",
+                 GNUNET_h2s (&query),
+                 prq.priority);
+#endif
       GNUNET_DATASTORE_put (dsh,
                            0, &query, dsize, &put[1],
                            type, prq.priority, 1 /* anonymity */, 
@@ -2814,13 +2833,21 @@
       GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
       return;
     }
+  prq.type = type;
+  prq.priority = priority;  
+  prq.finished = GNUNET_NO;
+  process_reply (&prq, key, pr);
+  if (prq.finished == GNUNET_YES)
+    return;
+  if (pr->qe == NULL)
+    return; /* done here */
   if ( (type == GNUNET_BLOCK_TYPE_DBLOCK) ||
        (type == GNUNET_BLOCK_TYPE_IBLOCK) ) 
     {
-      if (pr->qe != NULL)
-       GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
+      GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
+      return;
     }
-  else if ( (pr->client_request_list == NULL) &&
+  if ( (pr->client_request_list == NULL) &&
        ( (GNUNET_YES == test_load_too_high()) ||
         (pr->results_found > 5 + 2 * pr->priority) ) )
     {
@@ -2832,14 +2859,10 @@
                                gettext_noop ("# processing result set cut 
short due to load"),
                                1,
                                GNUNET_NO);
-      if (pr->qe != NULL)
-       GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
+      GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
+      return;
     }
-  else if (pr->qe != NULL)
-    GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
-  prq.type = type;
-  prq.priority = priority;  
-  process_reply (&prq, key, pr);
+  GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
 }
 
 
@@ -3062,7 +3085,7 @@
                                gettext_noop ("# requests dropped due TTL 
underflow"),
                                1,
                                GNUNET_NO);
-      /* integer underflow => drop (should be very rare)! */
+      /* integer underflow => drop (should be very rare)! */      
       GNUNET_free (pr);
       return GNUNET_OK;
     } 

Modified: gnunet/src/fs/gnunet-service-fs_indexing.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_indexing.c  2010-05-19 21:23:08 UTC (rev 
11440)
+++ gnunet/src/fs/gnunet-service-fs_indexing.c  2010-05-19 21:45:22 UTC (rev 
11441)
@@ -40,7 +40,7 @@
 #include "gnunet-service-fs_indexing.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_NO
+#define DEBUG_FS GNUNET_YES
 
 /**
  * In-memory information about indexed files (also available
@@ -367,6 +367,13 @@
   ii->filename = (const char*) &ii[1];
   memcpy (&ii[1], fn, slen);
   ii->file_id = ism->file_id;  
+#if DEBUG_FS
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Received `%s' message for file `%s'\n",
+             "START_INDEX",
+             ii->filename);
+#endif
+
   ii->tc = GNUNET_SERVER_transmit_context_create (client);
   mydev = 0;
   myino = 0;
@@ -610,8 +617,9 @@
                                        sizeof (ndata)))) )
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                 _("Could not access indexed file `%s' at offset %llu: %s\n"),
+                 _("Could not access indexed file `%s' (%s) at offset %llu: 
%s\n"),
                  GNUNET_h2s (&odb->file_id),
+                 fn,
                  (unsigned long long) off,
                  STRERROR (errno));
       if (fh != NULL)

Modified: gnunet/src/fs/test_fs_list_indexed_data.conf
===================================================================
--- gnunet/src/fs/test_fs_list_indexed_data.conf        2010-05-19 21:23:08 UTC 
(rev 11440)
+++ gnunet/src/fs/test_fs_list_indexed_data.conf        2010-05-19 21:45:22 UTC 
(rev 11441)
@@ -36,7 +36,7 @@
 [fs]
 PORT = 42471
 HOSTNAME = localhost
-#DEBUG = YES
+# DEBUG = YES
 
 [testing]
 WEAKRANDOM = YES

Modified: gnunet/src/fs/test_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_p2p.c  2010-05-19 21:23:08 UTC (rev 
11440)
+++ gnunet/src/fs/test_gnunet_service_fs_p2p.c  2010-05-19 21:45:22 UTC (rev 
11441)
@@ -26,7 +26,7 @@
 #include "platform.h"
 #include "fs_test_lib.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 /**
  * File-size we use for testing.




reply via email to

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