aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pr.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-03-27 14:08:36 +0000
committerChristian Grothoff <christian@grothoff.org>2011-03-27 14:08:36 +0000
commit816b7a1abcc0a5e6665273958101e3c95447e56b (patch)
treeaef8087e58080c229ea65b45856dfffa023f3523 /src/fs/gnunet-service-fs_pr.c
parent0c3d376ccca792725f0e080dc9a16fbd56e682b0 (diff)
downloadgnunet-816b7a1abcc0a5e6665273958101e3c95447e56b.tar.gz
gnunet-816b7a1abcc0a5e6665273958101e3c95447e56b.zip
stuff
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r--src/fs/gnunet-service-fs_pr.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 3bf429620..ed156daf5 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1189,6 +1189,16 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1189 &put_migration_continuation, 1189 &put_migration_continuation,
1190 start); 1190 start);
1191 } 1191 }
1192 else
1193 {
1194#if DEBUG_FS
1195 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1196 "Choosing not to keep content `%s' (%d/%d)\n",
1197 GNUNET_h2s (&query),
1198 active_to_migration,
1199 test_put_load_too_high (prq.priority));
1200#endif
1201 }
1192 putl = GNUNET_LOAD_get_load (datastore_put_load); 1202 putl = GNUNET_LOAD_get_load (datastore_put_load);
1193 if ( (NULL != (cp = prq.sender)) && 1203 if ( (NULL != (cp = prq.sender)) &&
1194 (GNUNET_NO == prq.request_found) && 1204 (GNUNET_NO == prq.request_found) &&
@@ -1201,7 +1211,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1201 5000 + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1211 5000 + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
1202 (unsigned int) (60000 * putl * putl))); 1212 (unsigned int) (60000 * putl * putl)));
1203 GSF_block_peer_migration_ (cp, block_time); 1213 GSF_block_peer_migration_ (cp, block_time);
1204 } 1214 }
1205 return GNUNET_OK; 1215 return GNUNET_OK;
1206} 1216}
1207 1217
@@ -1222,6 +1232,7 @@ GSF_pending_request_init_ ()
1222 _("Configuration fails to specify `%s', assuming default value."), 1232 _("Configuration fails to specify `%s', assuming default value."),
1223 "MAX_PENDING_REQUESTS"); 1233 "MAX_PENDING_REQUESTS");
1224 } 1234 }
1235 datastore_put_load = GNUNET_LOAD_value_init (DATASTORE_LOAD_AUTODECLINE);
1225 pr_map = GNUNET_CONTAINER_multihashmap_create (32 * 1024); 1236 pr_map = GNUNET_CONTAINER_multihashmap_create (32 * 1024);
1226 requests_by_expiration_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); 1237 requests_by_expiration_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
1227} 1238}
@@ -1240,6 +1251,8 @@ GSF_pending_request_done_ ()
1240 pr_map = NULL; 1251 pr_map = NULL;
1241 GNUNET_CONTAINER_heap_destroy (requests_by_expiration_heap); 1252 GNUNET_CONTAINER_heap_destroy (requests_by_expiration_heap);
1242 requests_by_expiration_heap = NULL; 1253 requests_by_expiration_heap = NULL;
1254 GNUNET_LOAD_value_free (datastore_put_load);
1255 datastore_put_load = NULL;
1243} 1256}
1244 1257
1245 1258