-options to play with
[oweals/gnunet.git] / src / fs / gnunet-service-fs.c
index 37f020806e1c1b895d8a4604399a82e87c421391..0f4d513ff2511143400f61a50b032f6fefa7d596 100644 (file)
@@ -22,9 +22,6 @@
  * @file fs/gnunet-service-fs.c
  * @brief gnunet anonymity protocol implementation
  * @author Christian Grothoff
- *
- * To use:
- * - consider re-issue GSF_dht_lookup_ after non-DHT reply received
  */
 #include "platform.h"
 #include <float.h>
@@ -397,7 +394,30 @@ start_p2p_processing (void *cls, struct GSF_PendingRequest *pr,
     GSF_pending_request_cancel_ (pr, GNUNET_YES);
     return;
   }
-  GSF_dht_lookup_ (pr);
+  if (0 == prd->anonymity_level)
+  {
+    switch (prd->type)
+    {
+    case GNUNET_BLOCK_TYPE_FS_DBLOCK:
+    case GNUNET_BLOCK_TYPE_FS_IBLOCK:
+      /* the above block types MAY be available via 'stream' */
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Considering stream-based download for block\n");
+      GSF_stream_lookup_ (pr);
+      break; 
+    case GNUNET_BLOCK_TYPE_FS_KBLOCK:
+    case GNUNET_BLOCK_TYPE_FS_SBLOCK:
+    case GNUNET_BLOCK_TYPE_FS_NBLOCK:
+      /* the above block types are in the DHT */
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Considering DHT-based search for block\n");
+      GSF_dht_lookup_ (pr);
+      break;
+    default:
+      GNUNET_break (0);
+      break;
+    }
+  }
   consider_forwarding (NULL, pr, result);
 }