int j;
unsigned long long size;
int i;
-
- GNUNET_HashCode key;
- size_t esize;
- char data[65536];
};
fprintf (stderr, "D");
#endif
GNUNET_assert (GNUNET_OK == success);
- GNUNET_SCHEDULER_add_continuation (&run_continuation,
- crc,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
-}
-
-
-
-static void
-do_delete (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- struct CpsRunContext *crc = cls;
-
- stored_bytes -= crc->esize;
- stored_entries--;
- stored_ops++;
- GNUNET_DATASTORE_remove (datastore,
- &crc->key,
- crc->esize,
- crc->data,
- 1, 1, TIMEOUT,
- &remove_next,
- crc);
+ GNUNET_SCHEDULER_add_now (&run_continuation,
+ crc);
}
-
static void
delete_value (void *cls,
const GNUNET_HashCode * key,
expiration, uint64_t uid)
{
struct CpsRunContext *crc = cls;
-
- if (key == NULL)
- {
- if (stored_bytes < MAX_SIZE)
- {
- crc->phase = RP_REPORT;
- GNUNET_SCHEDULER_add_continuation (&run_continuation,
- crc,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- return;
- }
- GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_HIGH,
- &do_delete,
- crc);
- return;
- }
+
+ GNUNET_assert (NULL != key);
+ stored_ops++;
+ stored_bytes -= size;
+ stored_entries--;
stored_ops++;
if (stored_bytes < MAX_SIZE)
- {
- GNUNET_DATASTORE_iterate_get_next (datastore);
- return;
- }
- crc->key = *key;
- crc->esize = size;
- memcpy (crc->data, data, size);
- GNUNET_DATASTORE_iterate_get_next (datastore);
+ crc->phase = RP_PUT;
+ GNUNET_assert (NULL !=
+ GNUNET_DATASTORE_remove (datastore,
+ key,
+ size,
+ data,
+ 1, 1, TIMEOUT,
+ &remove_next,
+ crc));
}
}
-
static void
run_tests (void *cls,
int success,