- case RP_PUT:
-#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Executing `%s' number %u\n",
- "PUT",
- crc->i);
-#endif
- GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
- GNUNET_DATASTORE_put (datastore,
- 0,
- &crc->key,
- get_size (crc->i),
- get_data (crc->i),
- get_type (crc->i),
- get_priority (crc->i),
- get_anonymity (crc->i),
- get_expiration (crc->i),
- 1, 1, TIMEOUT,
- &check_success,
- crc);
- crc->i++;
- if (crc->i == ITERATIONS)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Sleeping to give datastore time to clean up\n");
- sleep (5);
- crc->phase = RP_GET;
- crc->i--;
- }
- break;
- case RP_GET:
-#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Executing `%s' number %u\n",
- "GET",
- crc->i);
-#endif
- GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
- GNUNET_DATASTORE_get (datastore,
- &crc->key,
- get_type (crc->i),
- 1, 1, TIMEOUT,
- &check_value,
- crc);
- break;
- case RP_GET_FAIL:
-#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Executing `%s' number %u\n",
- "GET",
- crc->i);
-#endif
- GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
- GNUNET_DATASTORE_get (datastore,
- &crc->key,
- get_type (crc->i),
- 1, 1, TIMEOUT,
- &check_nothing,
- crc);
- break;
- case RP_DONE:
- GNUNET_assert (0 == crc->i);
-#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Finished, disconnecting\n");
-#endif
- GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
- GNUNET_free (crc);
- ok = 0;