actually limit FS memory consumption by limiting how many requests we track from...
authorChristian Grothoff <christian@grothoff.org>
Mon, 19 Dec 2011 14:10:15 +0000 (14:10 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 19 Dec 2011 14:10:15 +0000 (14:10 +0000)
src/fs/gnunet-service-fs_cp.c
src/fs/gnunet-service-fs_pr.c
src/fs/gnunet-service-fs_pr.h

index 7560975db9c43401c33ec2c4f48fc85e223784d2..968cdffcb089334eb07803fc4e4dd216de16089f 100644 (file)
@@ -1231,7 +1231,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
       (0 !=
        (bm & GET_MESSAGE_BIT_TRANSMIT_TO)) ? ((const struct GNUNET_PeerIdentity
                                                *) &opt[bits++]) : NULL;
-  options = 0;
+  options = GSF_PRO_DEFAULTS;
   spid = 0;
   if ((GNUNET_LOAD_get_load (cp->ppd.transmission_delay) > 3 * (1 + priority))
       || (GNUNET_LOAD_get_average (cp->ppd.transmission_delay) >
index 12245c8a6de7b315f2aee79905e8518e576558fe..49f395ef644c48d72cda0e5e3c6d12f3add9874c 100644 (file)
@@ -345,7 +345,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
   }
   GNUNET_CONTAINER_multihashmap_put (pr_map, query, pr,
                                      GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
-  if (0 != (options & GSF_PRO_REQUEST_EXPIRES))
+  if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES))
   {
     pr->hnode =
         GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr,
index e15ea0b54cbba8ffab2e8019e700ee1679446c85..f435cf8d677a9a6c2c59d02f04125e628fe8331c 100644 (file)
  */
 enum GSF_PendingRequestOptions
 {
+
+  /**
+   * No special options (P2P-default).
+   */
+  GSF_PRO_DEFAULTS = 0,
+
     /**
      * Request must only be processed locally.
      */
@@ -47,7 +53,7 @@ enum GSF_PendingRequestOptions
     /**
      * Request persists indefinitely (no expiration).
      */
-  GSF_PRO_REQUEST_EXPIRES = 4,
+  GSF_PRO_REQUEST_NEVER_EXPIRES = 4,
 
     /**
      * Request is allowed to refresh bloomfilter and change mingle value.
@@ -63,7 +69,7 @@ enum GSF_PendingRequestOptions
      * Option mask for typical local requests.
      */
   GSF_PRO_LOCAL_REQUEST =
-      (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED)
+      (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED | GSF_PRO_REQUEST_NEVER_EXPIRES)
 };