aboutsummaryrefslogtreecommitdiff
path: root/src/dht/test_dht_twopeer_get_put.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/test_dht_twopeer_get_put.c')
-rw-r--r--src/dht/test_dht_twopeer_get_put.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/dht/test_dht_twopeer_get_put.c b/src/dht/test_dht_twopeer_get_put.c
index 775418fe1..3a27db21b 100644
--- a/src/dht/test_dht_twopeer_get_put.c
+++ b/src/dht/test_dht_twopeer_get_put.c
@@ -214,22 +214,22 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
214 */ 214 */
215void 215void
216get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, 216get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
217 const GNUNET_HashCode * key, 217 const struct GNUNET_HashCode * key,
218 const struct GNUNET_PeerIdentity *get_path, 218 const struct GNUNET_PeerIdentity *get_path,
219 unsigned int get_path_size, 219 unsigned int get_path_size,
220 const struct GNUNET_PeerIdentity *put_path, 220 const struct GNUNET_PeerIdentity *put_path,
221 unsigned int put_path_size, enum GNUNET_BLOCK_Type type, 221 unsigned int put_path_size, enum GNUNET_BLOCK_Type type,
222 size_t size, const void *result_data) 222 size_t size, const void *result_data)
223{ 223{
224 GNUNET_HashCode original_key; /* Key data was stored data under */ 224 struct GNUNET_HashCode original_key; /* Key data was stored data under */
225 char original_data[4]; /* Made up data that was stored */ 225 char original_data[4]; /* Made up data that was stored */
226 226
227 memset (&original_key, 42, sizeof (GNUNET_HashCode)); /* Set the key to what it was set to previously */ 227 memset (&original_key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to what it was set to previously */
228 memset (original_data, 43, sizeof (original_data)); 228 memset (original_data, 43, sizeof (original_data));
229 229
230#if DNS 230#if DNS
231 if ((sizeof (original_data) != size) || 231 if ((sizeof (original_data) != size) ||
232 (0 != memcmp (&data.service_descriptor, key, sizeof (GNUNET_HashCode))) || 232 (0 != memcmp (&data.service_descriptor, key, sizeof (struct GNUNET_HashCode))) ||
233 (0 != memcmp ((char *) &data, result_data, sizeof (original_data)))) 233 (0 != memcmp ((char *) &data, result_data, sizeof (original_data))))
234 { 234 {
235 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 235 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -241,7 +241,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
241 } 241 }
242#else 242#else
243 if ((sizeof (original_data) != size) || 243 if ((sizeof (original_data) != size) ||
244 (0 != memcmp (&original_key, key, sizeof (GNUNET_HashCode))) || 244 (0 != memcmp (&original_key, key, sizeof (struct GNUNET_HashCode))) ||
245 (0 != memcmp (original_data, result_data, sizeof (original_data)))) 245 (0 != memcmp (original_data, result_data, sizeof (original_data))))
246 { 246 {
247 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 247 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -264,12 +264,12 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
264static void 264static void
265do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 265do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
266{ 266{
267 GNUNET_HashCode key; /* Key for data lookup */ 267 struct GNUNET_HashCode key; /* Key for data lookup */
268 268
269#if DNS 269#if DNS
270 memcpy (&key, &data.service_descriptor, sizeof (GNUNET_HashCode)); 270 memcpy (&key, &data.service_descriptor, sizeof (struct GNUNET_HashCode));
271#else 271#else
272 memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ 272 memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */
273#endif 273#endif
274 global_get_handle = 274 global_get_handle =
275 GNUNET_DHT_get_start (peer2dht, 275 GNUNET_DHT_get_start (peer2dht,
@@ -305,10 +305,10 @@ put_finished (void *cls, int success)
305static void 305static void
306do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 306do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
307{ 307{
308 GNUNET_HashCode key; /* Made up key to store data under */ 308 struct GNUNET_HashCode key; /* Made up key to store data under */
309 char data[4]; /* Made up data to store */ 309 char data[4]; /* Made up data to store */
310 310
311 memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */ 311 memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */
312 memset (data, 43, sizeof (data)); 312 memset (data, 43, sizeof (data));
313 313
314 /* Insert the data at the first peer */ 314 /* Insert the data at the first peer */