[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14592 - gnunet/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14592 - gnunet/src/fs |
Date: |
Fri, 4 Mar 2011 13:41:54 +0100 |
Author: grothoff
Date: 2011-03-04 13:41:54 +0100 (Fri, 04 Mar 2011)
New Revision: 14592
Modified:
gnunet/src/fs/gnunet-service-fs_put.c
Log:
fixes
Modified: gnunet/src/fs/gnunet-service-fs_put.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_put.c 2011-03-04 12:39:07 UTC (rev
14591)
+++ gnunet/src/fs/gnunet-service-fs_put.c 2011-03-04 12:41:54 UTC (rev
14592)
@@ -24,10 +24,17 @@
* @author Christian Grothoff
*/
#include "platform.h"
+#include "gnunet-service-fs.h"
#include "gnunet-service-fs_put.h"
/**
+ * How often do we at most PUT content into the DHT?
+ */
+#define MAX_DHT_PUT_FREQ GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 5)
+
+
+/**
* Request to datastore for DHT PUTs (or NULL).
*/
static struct GNUNET_DATASTORE_QueueEntry *dht_qe;
@@ -70,7 +77,7 @@
{
struct GNUNET_TIME_Relative delay;
- if (dsh == NULL)
+ if (GSF_dsh == NULL)
return;
if (dht_qe != NULL)
return;
@@ -96,6 +103,17 @@
/**
+ * Function called upon completion of the DHT PUT operation.
+ */
+static void
+dht_put_continuation (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);
+}
+
+
+/**
* Store content in DHT.
*
* @param cls closure
@@ -151,7 +169,7 @@
GNUNET_h2s (key),
type);
#endif
- GNUNET_DHT_put (dht_handle,
+ GNUNET_DHT_put (GSF_dht,
key,
DEFAULT_PUT_REPLICATION,
GNUNET_DHT_RO_NONE,
@@ -176,16 +194,16 @@
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
dht_task = GNUNET_SCHEDULER_NO_TASK;
- if (dsh != NULL)
- {
- if (dht_put_type == GNUNET_BLOCK_TYPE_FS_ONDEMAND)
- dht_put_type = GNUNET_BLOCK_TYPE_FS_KBLOCK;
- dht_qe = GNUNET_DATASTORE_get_zero_anonymity (dsh, 0, UINT_MAX,
-
GNUNET_TIME_UNIT_FOREVER_REL,
- dht_put_type++,
- &process_dht_put_content,
NULL);
- GNUNET_assert (dht_qe != NULL);
- }
+ if (GSF_dsh == NULL)
+ return;
+ if (dht_put_type == GNUNET_BLOCK_TYPE_FS_ONDEMAND)
+ dht_put_type = GNUNET_BLOCK_TYPE_FS_KBLOCK;
+ dht_qe = GNUNET_DATASTORE_get_zero_anonymity (GSF_dsh,
+ 0, UINT_MAX,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ dht_put_type++,
+ &process_dht_put_content, NULL);
+ GNUNET_assert (dht_qe != NULL);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14592 - gnunet/src/fs,
gnunet <=