aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-19 14:10:15 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-19 14:10:15 +0000
commit21a4795f1918e010a51b0d189fe01f77e1f5bbd6 (patch)
tree433e0566f6a4bdaf53e7de478ee261ef9f336047
parent61e81163b05a44b3d0e72b4ef8c781f98b6c2c6c (diff)
downloadgnunet-21a4795f1918e010a51b0d189fe01f77e1f5bbd6.tar.gz
gnunet-21a4795f1918e010a51b0d189fe01f77e1f5bbd6.zip
actually limit FS memory consumption by limiting how many requests we track from other peers (respective GSF-option had not been set; new code also inverts the meaning of the bit, so it does not have to be set for peers but rather is now set for clients to excempt them from the limitation)
-rw-r--r--src/fs/gnunet-service-fs_cp.c2
-rw-r--r--src/fs/gnunet-service-fs_pr.c2
-rw-r--r--src/fs/gnunet-service-fs_pr.h10
3 files changed, 10 insertions, 4 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 7560975db..968cdffcb 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -1231,7 +1231,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1231 (0 != 1231 (0 !=
1232 (bm & GET_MESSAGE_BIT_TRANSMIT_TO)) ? ((const struct GNUNET_PeerIdentity 1232 (bm & GET_MESSAGE_BIT_TRANSMIT_TO)) ? ((const struct GNUNET_PeerIdentity
1233 *) &opt[bits++]) : NULL; 1233 *) &opt[bits++]) : NULL;
1234 options = 0; 1234 options = GSF_PRO_DEFAULTS;
1235 spid = 0; 1235 spid = 0;
1236 if ((GNUNET_LOAD_get_load (cp->ppd.transmission_delay) > 3 * (1 + priority)) 1236 if ((GNUNET_LOAD_get_load (cp->ppd.transmission_delay) > 3 * (1 + priority))
1237 || (GNUNET_LOAD_get_average (cp->ppd.transmission_delay) > 1237 || (GNUNET_LOAD_get_average (cp->ppd.transmission_delay) >
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 12245c8a6..49f395ef6 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -345,7 +345,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
345 } 345 }
346 GNUNET_CONTAINER_multihashmap_put (pr_map, query, pr, 346 GNUNET_CONTAINER_multihashmap_put (pr_map, query, pr,
347 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 347 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
348 if (0 != (options & GSF_PRO_REQUEST_EXPIRES)) 348 if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES))
349 { 349 {
350 pr->hnode = 350 pr->hnode =
351 GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr, 351 GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr,
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h
index e15ea0b54..f435cf8d6 100644
--- a/src/fs/gnunet-service-fs_pr.h
+++ b/src/fs/gnunet-service-fs_pr.h
@@ -34,6 +34,12 @@
34 */ 34 */
35enum GSF_PendingRequestOptions 35enum GSF_PendingRequestOptions
36{ 36{
37
38 /**
39 * No special options (P2P-default).
40 */
41 GSF_PRO_DEFAULTS = 0,
42
37 /** 43 /**
38 * Request must only be processed locally. 44 * Request must only be processed locally.
39 */ 45 */
@@ -47,7 +53,7 @@ enum GSF_PendingRequestOptions
47 /** 53 /**
48 * Request persists indefinitely (no expiration). 54 * Request persists indefinitely (no expiration).
49 */ 55 */
50 GSF_PRO_REQUEST_EXPIRES = 4, 56 GSF_PRO_REQUEST_NEVER_EXPIRES = 4,
51 57
52 /** 58 /**
53 * Request is allowed to refresh bloomfilter and change mingle value. 59 * Request is allowed to refresh bloomfilter and change mingle value.
@@ -63,7 +69,7 @@ enum GSF_PendingRequestOptions
63 * Option mask for typical local requests. 69 * Option mask for typical local requests.
64 */ 70 */
65 GSF_PRO_LOCAL_REQUEST = 71 GSF_PRO_LOCAL_REQUEST =
66 (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED) 72 (GSF_PRO_BLOOMFILTER_FULL_REFRESH | GSF_PRO_PRIORITY_UNLIMITED | GSF_PRO_REQUEST_NEVER_EXPIRES)
67}; 73};
68 74
69 75