gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r12181 - gnunet/src/fs
Date: Wed, 7 Jul 2010 23:05:26 +0200

Author: grothoff
Date: 2010-07-07 23:05:26 +0200 (Wed, 07 Jul 2010)
New Revision: 12181

Modified:
   gnunet/src/fs/gnunet-service-fs.c
Log:
hackery

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2010-07-07 20:57:30 UTC (rev 12180)
+++ gnunet/src/fs/gnunet-service-fs.c   2010-07-07 21:05:26 UTC (rev 12181)
@@ -24,11 +24,9 @@
  * @author Christian Grothoff
  *
  * TODO:
- * - bound_priority should not charge if we are not loaded (excess-based 
economy)
- * - have a way to drop queries based on load (or just forward...)
+ * - implement test_load_too_high, make decision priority-based, implement 
forwarding, etc.
+ * - consider more precise latency estimation (per-peer & request)
  * - introduce random latency in processing
- * - consider more precise latency estimation (per-peer & request)
- * - better algorithm for priority selection for requests we initiate?
  * - tell other peers to stop migration if our PUTs fail (or if
  *   we don't support migration per configuration?)
  * - more statistics
@@ -1792,12 +1790,12 @@
  * to even consider processing the query at
  * all.
  * 
- * @return GNUNET_YES if the load is too high, GNUNET_NO otherwise
+ * @return GNUNET_YES if the load is too high to do anything, GNUNET_NO to 
forward (load high, but not too high), GNUNET_SYSERR to indirect (load low)
  */
 static int
 test_load_too_high ()
 {
-  return GNUNET_NO; // FIXME
+  return GNUNET_SYSERR; // FIXME
 }
 
 
@@ -3111,8 +3109,11 @@
 #define N ((double)128.0)
   uint32_t ret;
   double rret;
-  /* FIXME: check if load is low and we
-     hence should not charge... */
+  int ld;
+
+  ld = test_load_too_high ();
+  if (ld == GNUNET_SYSERR)
+    return 0; /* excess resources */
   ret = change_host_trust (cp, prio_in);
   if (ret > 0)
     {
@@ -3191,6 +3192,7 @@
   uint32_t ttl_decrement;
   enum GNUNET_BLOCK_Type type;
   int have_ns;
+  int ld;
 
   msize = ntohs(message->size);
   if (msize < sizeof (struct GetMessage))
@@ -3274,7 +3276,11 @@
   /* note that we can really only check load here since otherwise
      peers could find out that we are overloaded by not being
      disconnected after sending us a malformed query... */
-  if (GNUNET_YES == test_load_too_high ())
+
+  /* FIXME: query priority should play
+     a major role here! */
+  ld = test_load_too_high ();
+  if (GNUNET_YES == ld)
     {
 #if DEBUG_FS
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -3287,6 +3293,8 @@
                                GNUNET_NO);
       return GNUNET_OK;
     }
+  /* FIXME: if ld == GNUNET_NO, forward
+     instead of indirecting! */
 
 #if DEBUG_FS 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,




reply via email to

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