diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-02-11 14:13:14 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-02-11 14:13:14 +0100 |
commit | 17f443e05afc09f1a66f789a4a92fee41ed7f4ff (patch) | |
tree | 647d78c6325d6922d4fea7d8254e5a0a356fb7e2 | |
parent | 1c1c1f8836afbe41d553a2aeda660d033c889f5f (diff) | |
download | gnunet-17f443e05afc09f1a66f789a4a92fee41ed7f4ff.tar.gz gnunet-17f443e05afc09f1a66f789a4a92fee41ed7f4ff.zip |
-fix many compiler warnings
m--------- | contrib/gana | 0 | ||||
-rw-r--r-- | src/cli/reclaim/gnunet-did.c | 43 | ||||
-rw-r--r-- | src/lib/gnsrecord/gnsrecord_misc.c | 6 | ||||
-rw-r--r-- | src/lib/util/crypto_pkey.c | 138 | ||||
-rw-r--r-- | src/service/fs/fs_download.c | 7 | ||||
-rw-r--r-- | src/service/fs/meta_data.c | 27 | ||||
-rw-r--r-- | src/service/gns/gnunet-service-gns_resolver.c | 4 | ||||
-rw-r--r-- | src/service/messenger/messenger_api_cmd_join_room.c | 44 | ||||
-rw-r--r-- | src/service/peerstore/peerstore_api.c | 13 | ||||
-rw-r--r-- | src/service/reclaim/gnunet-service-reclaim.c | 4 | ||||
-rw-r--r-- | src/service/regex/regex_internal_dht.c | 12 | ||||
-rw-r--r-- | src/service/testing/gnunet-cmds-helper.c | 4 | ||||
-rw-r--r-- | src/service/transport/gnunet-communicator-udp.c | 47 | ||||
-rw-r--r-- | src/service/transport/test_transport_plugin_cmd_simple_send_performance.c | 10 |
14 files changed, 198 insertions, 161 deletions
diff --git a/contrib/gana b/contrib/gana | |||
Subproject ace673ed30067aa50ef5eebe16cc63ebe1ae066 | Subproject 4728c9e60ce121f439b3db30cc08f06ff0beff7 | ||
diff --git a/src/cli/reclaim/gnunet-did.c b/src/cli/reclaim/gnunet-did.c index 2350b6958..a8ac7652e 100644 --- a/src/cli/reclaim/gnunet-did.c +++ b/src/cli/reclaim/gnunet-did.c | |||
@@ -31,8 +31,8 @@ | |||
31 | * @author Tristan Schwieren | 31 | * @author Tristan Schwieren |
32 | * @file src/did/gnunet-did.c | 32 | * @file src/did/gnunet-did.c |
33 | * @brief DID Method Wrapper | 33 | * @brief DID Method Wrapper |
34 | * | ||
35 | */ | 34 | */ |
35 | #include "platform.h" | ||
36 | #include "gnunet_util_lib.h" | 36 | #include "gnunet_util_lib.h" |
37 | #include "gnunet_namestore_service.h" | 37 | #include "gnunet_namestore_service.h" |
38 | #include "gnunet_identity_service.h" | 38 | #include "gnunet_identity_service.h" |
@@ -145,6 +145,7 @@ cleanup (void *cls) | |||
145 | GNUNET_SCHEDULER_shutdown (); | 145 | GNUNET_SCHEDULER_shutdown (); |
146 | } | 146 | } |
147 | 147 | ||
148 | |||
148 | /** | 149 | /** |
149 | * @brief GNS lookup callback. Prints the DID Document to standard out. | 150 | * @brief GNS lookup callback. Prints the DID Document to standard out. |
150 | * Fails if there is more than one DID record. | 151 | * Fails if there is more than one DID record. |
@@ -170,6 +171,7 @@ print_did_document ( | |||
170 | return; | 171 | return; |
171 | } | 172 | } |
172 | 173 | ||
174 | |||
173 | /** | 175 | /** |
174 | * @brief Resolve a DID given by the user. | 176 | * @brief Resolve a DID given by the user. |
175 | */ | 177 | */ |
@@ -233,14 +235,16 @@ remove_did_document_namestore_cb (void *cls, enum GNUNET_ErrorCode ec) | |||
233 | event->cont (event->cls); | 235 | event->cont (event->cls); |
234 | free (event); | 236 | free (event); |
235 | } | 237 | } |
236 | else { | 238 | else |
239 | { | ||
237 | free (event); | 240 | free (event); |
238 | GNUNET_SCHEDULER_add_now (cleanup, NULL); | 241 | GNUNET_SCHEDULER_add_now (cleanup, NULL); |
239 | ret = 0; | 242 | ret = 0; |
240 | return; | 243 | return; |
241 | } | 244 | } |
242 | } | 245 | } |
243 | else { | 246 | else |
247 | { | ||
244 | printf ("Something went wrong when deleting the DID Document\n"); | 248 | printf ("Something went wrong when deleting the DID Document\n"); |
245 | 249 | ||
246 | printf ("%s\n", GNUNET_ErrorCode_get_hint (ec)); | 250 | printf ("%s\n", GNUNET_ErrorCode_get_hint (ec)); |
@@ -251,6 +255,7 @@ remove_did_document_namestore_cb (void *cls, enum GNUNET_ErrorCode ec) | |||
251 | } | 255 | } |
252 | } | 256 | } |
253 | 257 | ||
258 | |||
254 | /** | 259 | /** |
255 | * @brief Callback called after the ego has been locked up | 260 | * @brief Callback called after the ego has been locked up |
256 | * | 261 | * |
@@ -264,14 +269,15 @@ remove_did_document_ego_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) | |||
264 | GNUNET_IDENTITY_ego_get_private_key (ego); | 269 | GNUNET_IDENTITY_ego_get_private_key (ego); |
265 | 270 | ||
266 | GNUNET_NAMESTORE_record_set_store (namestore_handle, | 271 | GNUNET_NAMESTORE_record_set_store (namestore_handle, |
267 | skey, | 272 | skey, |
268 | GNUNET_GNS_EMPTY_LABEL_AT, | 273 | GNUNET_GNS_EMPTY_LABEL_AT, |
269 | 0, | 274 | 0, |
270 | NULL, | 275 | NULL, |
271 | &remove_did_document_namestore_cb, | 276 | &remove_did_document_namestore_cb, |
272 | cls); | 277 | cls); |
273 | } | 278 | } |
274 | 279 | ||
280 | |||
275 | /** | 281 | /** |
276 | * @brief Remove a DID Document | 282 | * @brief Remove a DID Document |
277 | */ | 283 | */ |
@@ -287,7 +293,8 @@ remove_did_document (remove_did_document_callback cont, void *cls) | |||
287 | ret = 1; | 293 | ret = 1; |
288 | return; | 294 | return; |
289 | } | 295 | } |
290 | else { | 296 | else |
297 | { | ||
291 | event = malloc (sizeof(*event)); | 298 | event = malloc (sizeof(*event)); |
292 | event->cont = cont; | 299 | event->cont = cont; |
293 | event->cls = cls; | 300 | event->cls = cls; |
@@ -299,6 +306,7 @@ remove_did_document (remove_did_document_callback cont, void *cls) | |||
299 | } | 306 | } |
300 | } | 307 | } |
301 | 308 | ||
309 | |||
302 | // Needed because create_did_ego_lookup_cb() and | 310 | // Needed because create_did_ego_lookup_cb() and |
303 | // create_did_ego_create_cb() can call each other | 311 | // create_did_ego_create_cb() can call each other |
304 | static void create_did_ego_lockup_cb (); | 312 | static void create_did_ego_lockup_cb (); |
@@ -327,6 +335,7 @@ create_did_cb (enum GNUNET_GenericReturnValue status, void *cls) | |||
327 | return; | 335 | return; |
328 | } | 336 | } |
329 | 337 | ||
338 | |||
330 | /** | 339 | /** |
331 | * @brief Create a DID(-Document) - Called after a new Identity has been created. | 340 | * @brief Create a DID(-Document) - Called after a new Identity has been created. |
332 | */ | 341 | */ |
@@ -349,6 +358,7 @@ create_did_ego_create_cb (void *cls, | |||
349 | NULL); | 358 | NULL); |
350 | } | 359 | } |
351 | 360 | ||
361 | |||
352 | /** | 362 | /** |
353 | * @brief Create a DID(-Document). Called after ego lookup | 363 | * @brief Create a DID(-Document). Called after ego lookup |
354 | * | 364 | * |
@@ -405,6 +415,7 @@ create_did_ego_lockup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) | |||
405 | } | 415 | } |
406 | } | 416 | } |
407 | 417 | ||
418 | |||
408 | /** | 419 | /** |
409 | * @brief Create a DID(-Document). | 420 | * @brief Create a DID(-Document). |
410 | * | 421 | * |
@@ -440,6 +451,7 @@ replace_did_document_ego_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) | |||
440 | // create_did_store (didd, ego); | 451 | // create_did_store (didd, ego); |
441 | } | 452 | } |
442 | 453 | ||
454 | |||
443 | /** | 455 | /** |
444 | * @brief Replace a DID Document. Callback functiona after remove | 456 | * @brief Replace a DID Document. Callback functiona after remove |
445 | * | 457 | * |
@@ -454,6 +466,7 @@ replace_did_document_remove_cb (void *cls) | |||
454 | NULL); | 466 | NULL); |
455 | } | 467 | } |
456 | 468 | ||
469 | |||
457 | /** | 470 | /** |
458 | * @brief Replace a DID Docuemnt | 471 | * @brief Replace a DID Docuemnt |
459 | * | 472 | * |
@@ -465,7 +478,8 @@ replace_did_document () | |||
465 | { | 478 | { |
466 | remove_did_document (&replace_did_document_remove_cb, NULL); | 479 | remove_did_document (&replace_did_document_remove_cb, NULL); |
467 | } | 480 | } |
468 | else { | 481 | else |
482 | { | ||
469 | printf ( | 483 | printf ( |
470 | "Set the DID Document and expiration time argument to replace the DID Document\n"); | 484 | "Set the DID Document and expiration time argument to replace the DID Document\n"); |
471 | GNUNET_SCHEDULER_add_now (&cleanup, NULL); | 485 | GNUNET_SCHEDULER_add_now (&cleanup, NULL); |
@@ -474,6 +488,7 @@ replace_did_document () | |||
474 | } | 488 | } |
475 | } | 489 | } |
476 | 490 | ||
491 | |||
477 | static void | 492 | static void |
478 | post_ego_iteration (void *cls) | 493 | post_ego_iteration (void *cls) |
479 | { | 494 | { |
@@ -495,13 +510,15 @@ post_ego_iteration (void *cls) | |||
495 | { | 510 | { |
496 | create_did (); | 511 | create_did (); |
497 | } | 512 | } |
498 | else { | 513 | else |
514 | { | ||
499 | // No Argument found | 515 | // No Argument found |
500 | GNUNET_SCHEDULER_add_now (&cleanup, NULL); | 516 | GNUNET_SCHEDULER_add_now (&cleanup, NULL); |
501 | return; | 517 | return; |
502 | } | 518 | } |
503 | } | 519 | } |
504 | 520 | ||
521 | |||
505 | static void | 522 | static void |
506 | process_dids (void *cls, struct GNUNET_IDENTITY_Ego *ego, | 523 | process_dids (void *cls, struct GNUNET_IDENTITY_Ego *ego, |
507 | void **ctx, const char*name) | 524 | void **ctx, const char*name) |
@@ -539,7 +556,6 @@ process_dids (void *cls, struct GNUNET_IDENTITY_Ego *ego, | |||
539 | } | 556 | } |
540 | 557 | ||
541 | 558 | ||
542 | |||
543 | static void | 559 | static void |
544 | run (void *cls, | 560 | run (void *cls, |
545 | char *const *args, | 561 | char *const *args, |
@@ -574,6 +590,7 @@ run (void *cls, | |||
574 | } | 590 | } |
575 | } | 591 | } |
576 | 592 | ||
593 | |||
577 | int | 594 | int |
578 | main (int argc, char *const argv[]) | 595 | main (int argc, char *const argv[]) |
579 | { | 596 | { |
diff --git a/src/lib/gnsrecord/gnsrecord_misc.c b/src/lib/gnsrecord/gnsrecord_misc.c index 0a94e1f78..ede3e23e4 100644 --- a/src/lib/gnsrecord/gnsrecord_misc.c +++ b/src/lib/gnsrecord/gnsrecord_misc.c | |||
@@ -122,9 +122,9 @@ GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a, | |||
122 | if (a->data_size != b->data_size) | 122 | if (a->data_size != b->data_size) |
123 | { | 123 | { |
124 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 124 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
125 | "Data size %lu != %lu\n", | 125 | "Data size %llu != %llu\n", |
126 | a->data_size, | 126 | (unsigned long long) a->data_size, |
127 | b->data_size); | 127 | (unsigned long long) b->data_size); |
128 | return GNUNET_NO; | 128 | return GNUNET_NO; |
129 | } | 129 | } |
130 | if (0 != memcmp (a->data, b->data, a->data_size)) | 130 | if (0 != memcmp (a->data, b->data, a->data_size)) |
diff --git a/src/lib/util/crypto_pkey.c b/src/lib/util/crypto_pkey.c index 0a55b3b65..a9d4831fb 100644 --- a/src/lib/util/crypto_pkey.c +++ b/src/lib/util/crypto_pkey.c | |||
@@ -45,7 +45,7 @@ check_key_type (uint32_t type) | |||
45 | 45 | ||
46 | ssize_t | 46 | ssize_t |
47 | GNUNET_CRYPTO_private_key_get_length (const struct | 47 | GNUNET_CRYPTO_private_key_get_length (const struct |
48 | GNUNET_CRYPTO_PrivateKey *key) | 48 | GNUNET_CRYPTO_PrivateKey *key) |
49 | { | 49 | { |
50 | switch (ntohl (key->type)) | 50 | switch (ntohl (key->type)) |
51 | { | 51 | { |
@@ -66,7 +66,7 @@ GNUNET_CRYPTO_private_key_get_length (const struct | |||
66 | 66 | ||
67 | ssize_t | 67 | ssize_t |
68 | GNUNET_CRYPTO_public_key_get_length (const struct | 68 | GNUNET_CRYPTO_public_key_get_length (const struct |
69 | GNUNET_CRYPTO_PublicKey *key) | 69 | GNUNET_CRYPTO_PublicKey *key) |
70 | { | 70 | { |
71 | switch (ntohl (key->type)) | 71 | switch (ntohl (key->type)) |
72 | { | 72 | { |
@@ -101,10 +101,10 @@ GNUNET_CRYPTO_private_key_length_by_type (enum GNUNET_CRYPTO_KeyType kt) | |||
101 | 101 | ||
102 | enum GNUNET_GenericReturnValue | 102 | enum GNUNET_GenericReturnValue |
103 | GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, | 103 | GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, |
104 | size_t len, | 104 | size_t len, |
105 | struct GNUNET_CRYPTO_PublicKey * | 105 | struct GNUNET_CRYPTO_PublicKey * |
106 | key, | 106 | key, |
107 | size_t *kb_read) | 107 | size_t *kb_read) |
108 | { | 108 | { |
109 | if (len < sizeof (key->type)) | 109 | if (len < sizeof (key->type)) |
110 | return GNUNET_SYSERR; | 110 | return GNUNET_SYSERR; |
@@ -126,9 +126,9 @@ GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, | |||
126 | 126 | ||
127 | ssize_t | 127 | ssize_t |
128 | GNUNET_CRYPTO_write_public_key_to_buffer (const struct | 128 | GNUNET_CRYPTO_write_public_key_to_buffer (const struct |
129 | GNUNET_CRYPTO_PublicKey *key, | 129 | GNUNET_CRYPTO_PublicKey *key, |
130 | void*buffer, | 130 | void*buffer, |
131 | size_t len) | 131 | size_t len) |
132 | { | 132 | { |
133 | const ssize_t length = GNUNET_CRYPTO_public_key_get_length (key); | 133 | const ssize_t length = GNUNET_CRYPTO_public_key_get_length (key); |
134 | if (len < length) | 134 | if (len < length) |
@@ -144,10 +144,10 @@ GNUNET_CRYPTO_write_public_key_to_buffer (const struct | |||
144 | 144 | ||
145 | enum GNUNET_GenericReturnValue | 145 | enum GNUNET_GenericReturnValue |
146 | GNUNET_CRYPTO_read_private_key_from_buffer (const void *buffer, | 146 | GNUNET_CRYPTO_read_private_key_from_buffer (const void *buffer, |
147 | size_t len, | 147 | size_t len, |
148 | struct | 148 | struct |
149 | GNUNET_CRYPTO_PrivateKey *key, | 149 | GNUNET_CRYPTO_PrivateKey *key, |
150 | size_t *kb_read) | 150 | size_t *kb_read) |
151 | { | 151 | { |
152 | if (len < sizeof (key->type)) | 152 | if (len < sizeof (key->type)) |
153 | return GNUNET_SYSERR; | 153 | return GNUNET_SYSERR; |
@@ -169,9 +169,9 @@ GNUNET_CRYPTO_read_private_key_from_buffer (const void *buffer, | |||
169 | 169 | ||
170 | ssize_t | 170 | ssize_t |
171 | GNUNET_CRYPTO_write_private_key_to_buffer (const struct | 171 | GNUNET_CRYPTO_write_private_key_to_buffer (const struct |
172 | GNUNET_CRYPTO_PrivateKey *key, | 172 | GNUNET_CRYPTO_PrivateKey *key, |
173 | void *buffer, | 173 | void *buffer, |
174 | size_t len) | 174 | size_t len) |
175 | { | 175 | { |
176 | const ssize_t length = GNUNET_CRYPTO_private_key_get_length (key); | 176 | const ssize_t length = GNUNET_CRYPTO_private_key_get_length (key); |
177 | if (len < length) | 177 | if (len < length) |
@@ -187,7 +187,7 @@ GNUNET_CRYPTO_write_private_key_to_buffer (const struct | |||
187 | 187 | ||
188 | ssize_t | 188 | ssize_t |
189 | GNUNET_CRYPTO_signature_get_length (const struct | 189 | GNUNET_CRYPTO_signature_get_length (const struct |
190 | GNUNET_CRYPTO_Signature *sig) | 190 | GNUNET_CRYPTO_Signature *sig) |
191 | { | 191 | { |
192 | switch (ntohl (sig->type)) | 192 | switch (ntohl (sig->type)) |
193 | { | 193 | { |
@@ -224,9 +224,9 @@ GNUNET_CRYPTO_signature_get_raw_length_by_type (uint32_t type) | |||
224 | 224 | ||
225 | ssize_t | 225 | ssize_t |
226 | GNUNET_CRYPTO_read_signature_from_buffer (struct | 226 | GNUNET_CRYPTO_read_signature_from_buffer (struct |
227 | GNUNET_CRYPTO_Signature *sig, | 227 | GNUNET_CRYPTO_Signature *sig, |
228 | const void*buffer, | 228 | const void*buffer, |
229 | size_t len) | 229 | size_t len) |
230 | { | 230 | { |
231 | if (len < sizeof (sig->type)) | 231 | if (len < sizeof (sig->type)) |
232 | return -1; | 232 | return -1; |
@@ -244,9 +244,9 @@ GNUNET_CRYPTO_read_signature_from_buffer (struct | |||
244 | 244 | ||
245 | ssize_t | 245 | ssize_t |
246 | GNUNET_CRYPTO_write_signature_to_buffer (const struct | 246 | GNUNET_CRYPTO_write_signature_to_buffer (const struct |
247 | GNUNET_CRYPTO_Signature *sig, | 247 | GNUNET_CRYPTO_Signature *sig, |
248 | void*buffer, | 248 | void*buffer, |
249 | size_t len) | 249 | size_t len) |
250 | { | 250 | { |
251 | const ssize_t length = GNUNET_CRYPTO_signature_get_length (sig); | 251 | const ssize_t length = GNUNET_CRYPTO_signature_get_length (sig); |
252 | if (len < length) | 252 | if (len < length) |
@@ -262,10 +262,10 @@ GNUNET_CRYPTO_write_signature_to_buffer (const struct | |||
262 | 262 | ||
263 | enum GNUNET_GenericReturnValue | 263 | enum GNUNET_GenericReturnValue |
264 | GNUNET_CRYPTO_sign_raw_ (const struct | 264 | GNUNET_CRYPTO_sign_raw_ (const struct |
265 | GNUNET_CRYPTO_PrivateKey *priv, | 265 | GNUNET_CRYPTO_PrivateKey *priv, |
266 | const struct | 266 | const struct |
267 | GNUNET_CRYPTO_EccSignaturePurpose *purpose, | 267 | GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
268 | unsigned char *sig) | 268 | unsigned char *sig) |
269 | { | 269 | { |
270 | switch (ntohl (priv->type)) | 270 | switch (ntohl (priv->type)) |
271 | { | 271 | { |
@@ -289,10 +289,10 @@ GNUNET_CRYPTO_sign_raw_ (const struct | |||
289 | 289 | ||
290 | enum GNUNET_GenericReturnValue | 290 | enum GNUNET_GenericReturnValue |
291 | GNUNET_CRYPTO_sign_ (const struct | 291 | GNUNET_CRYPTO_sign_ (const struct |
292 | GNUNET_CRYPTO_PrivateKey *priv, | 292 | GNUNET_CRYPTO_PrivateKey *priv, |
293 | const struct | 293 | const struct |
294 | GNUNET_CRYPTO_EccSignaturePurpose *purpose, | 294 | GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
295 | struct GNUNET_CRYPTO_Signature *sig) | 295 | struct GNUNET_CRYPTO_Signature *sig) |
296 | { | 296 | { |
297 | sig->type = priv->type; | 297 | sig->type = priv->type; |
298 | switch (ntohl (priv->type)) | 298 | switch (ntohl (priv->type)) |
@@ -315,10 +315,10 @@ GNUNET_CRYPTO_sign_ (const struct | |||
315 | 315 | ||
316 | enum GNUNET_GenericReturnValue | 316 | enum GNUNET_GenericReturnValue |
317 | GNUNET_CRYPTO_signature_verify_ (uint32_t purpose, | 317 | GNUNET_CRYPTO_signature_verify_ (uint32_t purpose, |
318 | const struct | 318 | const struct |
319 | GNUNET_CRYPTO_EccSignaturePurpose *validate, | 319 | GNUNET_CRYPTO_EccSignaturePurpose *validate, |
320 | const struct GNUNET_CRYPTO_Signature *sig, | 320 | const struct GNUNET_CRYPTO_Signature *sig, |
321 | const struct GNUNET_CRYPTO_PublicKey *pub) | 321 | const struct GNUNET_CRYPTO_PublicKey *pub) |
322 | { | 322 | { |
323 | /* check type matching of 'sig' and 'pub' */ | 323 | /* check type matching of 'sig' and 'pub' */ |
324 | GNUNET_assert (ntohl (pub->type) == ntohl (sig->type)); | 324 | GNUNET_assert (ntohl (pub->type) == ntohl (sig->type)); |
@@ -344,12 +344,12 @@ GNUNET_CRYPTO_signature_verify_ (uint32_t purpose, | |||
344 | 344 | ||
345 | enum GNUNET_GenericReturnValue | 345 | enum GNUNET_GenericReturnValue |
346 | GNUNET_CRYPTO_signature_verify_raw_ (uint32_t purpose, | 346 | GNUNET_CRYPTO_signature_verify_raw_ (uint32_t purpose, |
347 | const struct | 347 | const struct |
348 | GNUNET_CRYPTO_EccSignaturePurpose * | 348 | GNUNET_CRYPTO_EccSignaturePurpose * |
349 | validate, | 349 | validate, |
350 | const unsigned char *sig, | 350 | const unsigned char *sig, |
351 | const struct | 351 | const struct |
352 | GNUNET_CRYPTO_PublicKey *pub) | 352 | GNUNET_CRYPTO_PublicKey *pub) |
353 | { | 353 | { |
354 | switch (ntohl (pub->type)) | 354 | switch (ntohl (pub->type)) |
355 | { | 355 | { |
@@ -375,10 +375,10 @@ GNUNET_CRYPTO_signature_verify_raw_ (uint32_t purpose, | |||
375 | 375 | ||
376 | ssize_t | 376 | ssize_t |
377 | GNUNET_CRYPTO_encrypt_old (const void *block, | 377 | GNUNET_CRYPTO_encrypt_old (const void *block, |
378 | size_t size, | 378 | size_t size, |
379 | const struct GNUNET_CRYPTO_PublicKey *pub, | 379 | const struct GNUNET_CRYPTO_PublicKey *pub, |
380 | struct GNUNET_CRYPTO_EcdhePublicKey *ecc, | 380 | struct GNUNET_CRYPTO_EcdhePublicKey *ecc, |
381 | void *result) | 381 | void *result) |
382 | { | 382 | { |
383 | struct GNUNET_CRYPTO_EcdhePrivateKey pk; | 383 | struct GNUNET_CRYPTO_EcdhePrivateKey pk; |
384 | GNUNET_CRYPTO_ecdhe_key_create (&pk); | 384 | GNUNET_CRYPTO_ecdhe_key_create (&pk); |
@@ -414,10 +414,10 @@ GNUNET_CRYPTO_encrypt_old (const void *block, | |||
414 | 414 | ||
415 | enum GNUNET_GenericReturnValue | 415 | enum GNUNET_GenericReturnValue |
416 | GNUNET_CRYPTO_encrypt (const void *pt, | 416 | GNUNET_CRYPTO_encrypt (const void *pt, |
417 | size_t pt_size, | 417 | size_t pt_size, |
418 | const struct GNUNET_CRYPTO_PublicKey *pub, | 418 | const struct GNUNET_CRYPTO_PublicKey *pub, |
419 | void *ct_buf, | 419 | void *ct_buf, |
420 | size_t ct_size) | 420 | size_t ct_size) |
421 | { | 421 | { |
422 | struct GNUNET_HashCode k; | 422 | struct GNUNET_HashCode k; |
423 | struct GNUNET_CRYPTO_FoKemC kemc; | 423 | struct GNUNET_CRYPTO_FoKemC kemc; |
@@ -429,8 +429,10 @@ GNUNET_CRYPTO_encrypt (const void *pt, | |||
429 | if (ct_size < pt_size + GNUNET_CRYPTO_ENCRYPT_OVERHEAD_BYTES) | 429 | if (ct_size < pt_size + GNUNET_CRYPTO_ENCRYPT_OVERHEAD_BYTES) |
430 | { | 430 | { |
431 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 431 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
432 | "Output buffer size for ciphertext too small: Got %lu, want >=%lu\n", | 432 | "Output buffer size for ciphertext too small: Got %llu, want >= %llu\n", |
433 | ct_size, pt_size + GNUNET_CRYPTO_ENCRYPT_OVERHEAD_BYTES); | 433 | (unsigned long long) ct_size, |
434 | (unsigned long long) (pt_size | ||
435 | + GNUNET_CRYPTO_ENCRYPT_OVERHEAD_BYTES)); | ||
434 | return GNUNET_SYSERR; | 436 | return GNUNET_SYSERR; |
435 | } | 437 | } |
436 | switch (ntohl (pub->type)) | 438 | switch (ntohl (pub->type)) |
@@ -463,10 +465,10 @@ GNUNET_CRYPTO_encrypt (const void *pt, | |||
463 | 465 | ||
464 | enum GNUNET_GenericReturnValue | 466 | enum GNUNET_GenericReturnValue |
465 | GNUNET_CRYPTO_decrypt (const void *ct_buf, | 467 | GNUNET_CRYPTO_decrypt (const void *ct_buf, |
466 | size_t ct_size, | 468 | size_t ct_size, |
467 | const struct GNUNET_CRYPTO_PrivateKey *priv, | 469 | const struct GNUNET_CRYPTO_PrivateKey *priv, |
468 | void *pt, | 470 | void *pt, |
469 | size_t pt_size) | 471 | size_t pt_size) |
470 | { | 472 | { |
471 | struct GNUNET_HashCode k; | 473 | struct GNUNET_HashCode k; |
472 | struct GNUNET_CRYPTO_FoKemC *kemc = (struct GNUNET_CRYPTO_FoKemC*) ct_buf; | 474 | struct GNUNET_CRYPTO_FoKemC *kemc = (struct GNUNET_CRYPTO_FoKemC*) ct_buf; |
@@ -478,8 +480,9 @@ GNUNET_CRYPTO_decrypt (const void *ct_buf, | |||
478 | if (pt_size < expected_pt_len) | 480 | if (pt_size < expected_pt_len) |
479 | { | 481 | { |
480 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 482 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
481 | "Output buffer size for plaintext too small: Got %lu, want >=%lu\n", | 483 | "Output buffer size for plaintext too small: Got %llu, want >= %llu\n", |
482 | pt_size, expected_pt_len); | 484 | (unsigned long long) pt_size, |
485 | (unsigned long long) expected_pt_len); | ||
483 | return GNUNET_SYSERR; | 486 | return GNUNET_SYSERR; |
484 | } | 487 | } |
485 | switch (ntohl (priv->type)) | 488 | switch (ntohl (priv->type)) |
@@ -511,10 +514,10 @@ GNUNET_CRYPTO_decrypt (const void *ct_buf, | |||
511 | 514 | ||
512 | ssize_t | 515 | ssize_t |
513 | GNUNET_CRYPTO_decrypt_old (const void *block, | 516 | GNUNET_CRYPTO_decrypt_old (const void *block, |
514 | size_t size, | 517 | size_t size, |
515 | const struct GNUNET_CRYPTO_PrivateKey *priv, | 518 | const struct GNUNET_CRYPTO_PrivateKey *priv, |
516 | const struct GNUNET_CRYPTO_EcdhePublicKey *ecc, | 519 | const struct GNUNET_CRYPTO_EcdhePublicKey *ecc, |
517 | void *result) | 520 | void *result) |
518 | { | 521 | { |
519 | struct GNUNET_HashCode hash; | 522 | struct GNUNET_HashCode hash; |
520 | switch (ntohl (priv->type)) | 523 | switch (ntohl (priv->type)) |
@@ -546,7 +549,7 @@ GNUNET_CRYPTO_decrypt_old (const void *block, | |||
546 | 549 | ||
547 | char * | 550 | char * |
548 | GNUNET_CRYPTO_public_key_to_string (const struct | 551 | GNUNET_CRYPTO_public_key_to_string (const struct |
549 | GNUNET_CRYPTO_PublicKey *key) | 552 | GNUNET_CRYPTO_PublicKey *key) |
550 | { | 553 | { |
551 | size_t size = GNUNET_CRYPTO_public_key_get_length (key); | 554 | size_t size = GNUNET_CRYPTO_public_key_get_length (key); |
552 | return GNUNET_STRINGS_data_to_string_alloc (key, | 555 | return GNUNET_STRINGS_data_to_string_alloc (key, |
@@ -556,7 +559,7 @@ GNUNET_CRYPTO_public_key_to_string (const struct | |||
556 | 559 | ||
557 | char * | 560 | char * |
558 | GNUNET_CRYPTO_private_key_to_string (const struct | 561 | GNUNET_CRYPTO_private_key_to_string (const struct |
559 | GNUNET_CRYPTO_PrivateKey *key) | 562 | GNUNET_CRYPTO_PrivateKey *key) |
560 | { | 563 | { |
561 | size_t size = GNUNET_CRYPTO_private_key_get_length (key); | 564 | size_t size = GNUNET_CRYPTO_private_key_get_length (key); |
562 | return GNUNET_STRINGS_data_to_string_alloc (key, | 565 | return GNUNET_STRINGS_data_to_string_alloc (key, |
@@ -566,7 +569,7 @@ GNUNET_CRYPTO_private_key_to_string (const struct | |||
566 | 569 | ||
567 | enum GNUNET_GenericReturnValue | 570 | enum GNUNET_GenericReturnValue |
568 | GNUNET_CRYPTO_public_key_from_string (const char *str, | 571 | GNUNET_CRYPTO_public_key_from_string (const char *str, |
569 | struct GNUNET_CRYPTO_PublicKey *key) | 572 | struct GNUNET_CRYPTO_PublicKey *key) |
570 | { | 573 | { |
571 | enum GNUNET_GenericReturnValue ret; | 574 | enum GNUNET_GenericReturnValue ret; |
572 | ret = GNUNET_STRINGS_string_to_data (str, | 575 | ret = GNUNET_STRINGS_string_to_data (str, |
@@ -582,7 +585,7 @@ GNUNET_CRYPTO_public_key_from_string (const char *str, | |||
582 | 585 | ||
583 | enum GNUNET_GenericReturnValue | 586 | enum GNUNET_GenericReturnValue |
584 | GNUNET_CRYPTO_private_key_from_string (const char *str, | 587 | GNUNET_CRYPTO_private_key_from_string (const char *str, |
585 | struct GNUNET_CRYPTO_PrivateKey *key) | 588 | struct GNUNET_CRYPTO_PrivateKey *key) |
586 | { | 589 | { |
587 | enum GNUNET_GenericReturnValue ret; | 590 | enum GNUNET_GenericReturnValue ret; |
588 | ret = GNUNET_STRINGS_string_to_data (str, | 591 | ret = GNUNET_STRINGS_string_to_data (str, |
@@ -594,10 +597,11 @@ GNUNET_CRYPTO_private_key_from_string (const char *str, | |||
594 | return check_key_type (ntohl (key->type)); | 597 | return check_key_type (ntohl (key->type)); |
595 | } | 598 | } |
596 | 599 | ||
600 | |||
597 | enum GNUNET_GenericReturnValue | 601 | enum GNUNET_GenericReturnValue |
598 | GNUNET_CRYPTO_key_get_public (const struct | 602 | GNUNET_CRYPTO_key_get_public (const struct |
599 | GNUNET_CRYPTO_PrivateKey *privkey, | 603 | GNUNET_CRYPTO_PrivateKey *privkey, |
600 | struct GNUNET_CRYPTO_PublicKey *key) | 604 | struct GNUNET_CRYPTO_PublicKey *key) |
601 | { | 605 | { |
602 | key->type = privkey->type; | 606 | key->type = privkey->type; |
603 | switch (ntohl (privkey->type)) | 607 | switch (ntohl (privkey->type)) |
diff --git a/src/service/fs/fs_download.c b/src/service/fs/fs_download.c index 2a21e4810..cee64466d 100644 --- a/src/service/fs/fs_download.c +++ b/src/service/fs/fs_download.c | |||
@@ -1041,13 +1041,12 @@ process_result_with_request (void *cls, | |||
1041 | { | 1041 | { |
1042 | GNUNET_asprintf ( | 1042 | GNUNET_asprintf ( |
1043 | &dc->emsg, | 1043 | &dc->emsg, |
1044 | _ ( | 1044 | "Internal error or bogus download URI (expected %llu bytes at depth %u and offset %llu/%llu, got %llu bytes)", |
1045 | "Internal error or bogus download URI (expected %lu bytes at depth %u and offset %llu/%llu, got %lu bytes)"), | 1045 | (unsigned long long) bs, |
1046 | bs, | ||
1047 | dr->depth, | 1046 | dr->depth, |
1048 | (unsigned long long) dr->offset, | 1047 | (unsigned long long) dr->offset, |
1049 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk.file_length), | 1048 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk.file_length), |
1050 | prc->size); | 1049 | (unsigned long long) prc->size); |
1051 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s\n", dc->emsg); | 1050 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s\n", dc->emsg); |
1052 | while (NULL != dr->parent) | 1051 | while (NULL != dr->parent) |
1053 | { | 1052 | { |
diff --git a/src/service/fs/meta_data.c b/src/service/fs/meta_data.c index 1e75ecf6c..b3db0e6c7 100644 --- a/src/service/fs/meta_data.c +++ b/src/service/fs/meta_data.c | |||
@@ -39,7 +39,6 @@ | |||
39 | __VA_ARGS__) | 39 | __VA_ARGS__) |
40 | 40 | ||
41 | 41 | ||
42 | |||
43 | /** | 42 | /** |
44 | * Meta data item. | 43 | * Meta data item. |
45 | */ | 44 | */ |
@@ -1039,6 +1038,7 @@ GNUNET_FS_meta_data_deserialize (const char *input, size_t size) | |||
1039 | return md; | 1038 | return md; |
1040 | } | 1039 | } |
1041 | 1040 | ||
1041 | |||
1042 | /** | 1042 | /** |
1043 | * Read a metadata container. | 1043 | * Read a metadata container. |
1044 | * | 1044 | * |
@@ -1097,6 +1097,7 @@ GNUNET_FS_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | |||
1097 | return GNUNET_OK; | 1097 | return GNUNET_OK; |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | |||
1100 | /** | 1101 | /** |
1101 | * Write a metadata container. | 1102 | * Write a metadata container. |
1102 | * | 1103 | * |
@@ -1120,22 +1121,27 @@ GNUNET_FS_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
1120 | &buf, | 1121 | &buf, |
1121 | MAX_META_DATA, | 1122 | MAX_META_DATA, |
1122 | GNUNET_FS_META_DATA_SERIALIZE_PART); | 1123 | GNUNET_FS_META_DATA_SERIALIZE_PART); |
1123 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1124 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1124 | _ ("Serialized %ld bytes of metadata"), | 1125 | "Serialized %lld bytes of metadata", |
1125 | size); | 1126 | (long long) size); |
1126 | 1127 | ||
1127 | if (-1 == size) | 1128 | if (-1 == size) |
1128 | { | 1129 | { |
1129 | GNUNET_free (buf); | 1130 | GNUNET_free (buf); |
1130 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1131 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1131 | _ ("Failed to serialize metadata `%s'"), | 1132 | "Failed to serialize metadata `%s'", |
1132 | what); | 1133 | what); |
1133 | return GNUNET_SYSERR; | 1134 | return GNUNET_SYSERR; |
1134 | } | 1135 | } |
1135 | if ((GNUNET_OK != GNUNET_BIO_write_int32 (h, | 1136 | if ( (GNUNET_OK != |
1136 | _ ("metadata length"), | 1137 | GNUNET_BIO_write_int32 (h, |
1137 | (uint32_t) size)) | 1138 | "metadata length", |
1138 | || (GNUNET_OK != GNUNET_BIO_write (h, what, buf, size))) | 1139 | (uint32_t) size)) || |
1140 | (GNUNET_OK != | ||
1141 | GNUNET_BIO_write (h, | ||
1142 | what, | ||
1143 | buf, | ||
1144 | size)) ) | ||
1139 | { | 1145 | { |
1140 | GNUNET_free (buf); | 1146 | GNUNET_free (buf); |
1141 | return GNUNET_SYSERR; | 1147 | return GNUNET_SYSERR; |
@@ -1144,6 +1150,7 @@ GNUNET_FS_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
1144 | return GNUNET_OK; | 1150 | return GNUNET_OK; |
1145 | } | 1151 | } |
1146 | 1152 | ||
1153 | |||
1147 | /** | 1154 | /** |
1148 | * Function used internally to read a metadata container from within a read | 1155 | * Function used internally to read a metadata container from within a read |
1149 | * spec. | 1156 | * spec. |
@@ -1166,6 +1173,7 @@ read_spec_handler_meta_data (void *cls, | |||
1166 | return GNUNET_FS_read_meta_data (h, what, result); | 1173 | return GNUNET_FS_read_meta_data (h, what, result); |
1167 | } | 1174 | } |
1168 | 1175 | ||
1176 | |||
1169 | /** | 1177 | /** |
1170 | * Create the specification to read a metadata container. | 1178 | * Create the specification to read a metadata container. |
1171 | * | 1179 | * |
@@ -1187,6 +1195,7 @@ GNUNET_FS_read_spec_meta_data (const char *what, | |||
1187 | return rs; | 1195 | return rs; |
1188 | } | 1196 | } |
1189 | 1197 | ||
1198 | |||
1190 | /** | 1199 | /** |
1191 | * Function used internally to write a metadata container from within a write | 1200 | * Function used internally to write a metadata container from within a write |
1192 | * spec. | 1201 | * spec. |
diff --git a/src/service/gns/gnunet-service-gns_resolver.c b/src/service/gns/gnunet-service-gns_resolver.c index 0d7a1cee8..b14500ab7 100644 --- a/src/service/gns/gnunet-service-gns_resolver.c +++ b/src/service/gns/gnunet-service-gns_resolver.c | |||
@@ -2592,8 +2592,8 @@ handle_dht_response (void *cls, | |||
2592 | return; | 2592 | return; |
2593 | } | 2593 | } |
2594 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2594 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2595 | "Decrypting DHT block of size %lu for `%s', expires %s\n", | 2595 | "Decrypting DHT block of size %llu for `%s', expires %s\n", |
2596 | GNUNET_GNSRECORD_block_get_size (block), | 2596 | (unsigned long long) GNUNET_GNSRECORD_block_get_size (block), |
2597 | rh->name, | 2597 | rh->name, |
2598 | GNUNET_STRINGS_absolute_time_to_string (exp)); | 2598 | GNUNET_STRINGS_absolute_time_to_string (exp)); |
2599 | if (GNUNET_OK != | 2599 | if (GNUNET_OK != |
diff --git a/src/service/messenger/messenger_api_cmd_join_room.c b/src/service/messenger/messenger_api_cmd_join_room.c index 4e9cf1e22..8151dc88e 100644 --- a/src/service/messenger/messenger_api_cmd_join_room.c +++ b/src/service/messenger/messenger_api_cmd_join_room.c | |||
@@ -46,9 +46,9 @@ join_room_run (void *cls, | |||
46 | struct GNUNET_HashCode key; | 46 | struct GNUNET_HashCode key; |
47 | 47 | ||
48 | if (jrs->room_key) | 48 | if (jrs->room_key) |
49 | GNUNET_CRYPTO_hash(jrs->room_key, strlen(jrs->room_key), &key); | 49 | GNUNET_CRYPTO_hash (jrs->room_key, strlen (jrs->room_key), &key); |
50 | else | 50 | else |
51 | memset(&key, 0, sizeof(key)); | 51 | memset (&key, 0, sizeof(key)); |
52 | 52 | ||
53 | const struct GNUNET_TESTING_Command *service_cmd; | 53 | const struct GNUNET_TESTING_Command *service_cmd; |
54 | service_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 54 | service_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
@@ -59,17 +59,17 @@ join_room_run (void *cls, | |||
59 | 59 | ||
60 | unsigned int peer_index; | 60 | unsigned int peer_index; |
61 | unsigned int stage_index; | 61 | unsigned int stage_index; |
62 | |||
63 | struct GNUNET_MESSENGER_RoomState *rs; | 62 | struct GNUNET_MESSENGER_RoomState *rs; |
64 | rs = rs = GNUNET_CONTAINER_multihashmap_get (sss->rooms, &key); | 63 | |
64 | rs = GNUNET_CONTAINER_multihashmap_get (sss->rooms, &key); | ||
65 | if (rs) | 65 | if (rs) |
66 | goto skip_room_state; | 66 | goto skip_room_state; |
67 | 67 | ||
68 | rs = GNUNET_MESSENGER_create_room_state(sss->topology); | 68 | rs = GNUNET_MESSENGER_create_room_state (sss->topology); |
69 | if ((!rs) && (GNUNET_OK != GNUNET_CONTAINER_multihashmap_put (sss->rooms, | 69 | if ((! rs) && (GNUNET_OK != GNUNET_CONTAINER_multihashmap_put (sss->rooms, |
70 | &key, | 70 | &key, |
71 | rs, | 71 | rs, |
72 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))) | 72 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))) |
73 | { | 73 | { |
74 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 74 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
75 | "Testing library failed to create a room state with key '%s'\n", | 75 | "Testing library failed to create a room state with key '%s'\n", |
@@ -82,22 +82,24 @@ skip_room_state: | |||
82 | peer_index = sss->peer_index; | 82 | peer_index = sss->peer_index; |
83 | stage_index = sss->stage_index; | 83 | stage_index = sss->stage_index; |
84 | 84 | ||
85 | const unsigned int index = stage_index * sss->topology->peer_amount + peer_index; | 85 | const unsigned int index = stage_index * sss->topology->peer_amount |
86 | const struct GNUNET_MESSENGER_TestStage *stage = &(sss->topology->peer_stages[index]); | 86 | + peer_index; |
87 | const struct GNUNET_MESSENGER_TestStage *stage = | ||
88 | &(sss->topology->peer_stages[index]); | ||
87 | 89 | ||
88 | unsigned int door_index = stage->door_id; | 90 | unsigned int door_index = stage->door_id; |
89 | 91 | ||
90 | if (door_index == 0) | 92 | if (door_index == 0) |
91 | door_index = (peer_index + GNUNET_CRYPTO_random_u32 ( | 93 | door_index = (peer_index + GNUNET_CRYPTO_random_u32 ( |
92 | GNUNET_CRYPTO_QUALITY_WEAK, | 94 | GNUNET_CRYPTO_QUALITY_WEAK, |
93 | sss->topology->peer_amount - 1 | 95 | sss->topology->peer_amount - 1 |
94 | ) + 1) % sss->topology->peer_amount; | 96 | ) + 1) % sss->topology->peer_amount; |
95 | else | 97 | else |
96 | door_index = (door_index - 1) % sss->topology->peer_amount; | 98 | door_index = (door_index - 1) % sss->topology->peer_amount; |
97 | 99 | ||
98 | struct GNUNET_PeerIdentity *door; | 100 | struct GNUNET_PeerIdentity *door; |
99 | door = GNUNET_TESTING_get_peer(door_index, sss->tl_system); | 101 | door = GNUNET_TESTING_get_peer (door_index, sss->tl_system); |
100 | if (!door) | 102 | if (! door) |
101 | { | 103 | { |
102 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 104 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
103 | "Testing library failed to get peer identity of index '%u'\n", | 105 | "Testing library failed to get peer identity of index '%u'\n", |
@@ -112,7 +114,7 @@ skip_room_state: | |||
112 | case GNUNET_MESSENGER_STAGE_JOIN_OPEN_ROOM: | 114 | case GNUNET_MESSENGER_STAGE_JOIN_OPEN_ROOM: |
113 | room = GNUNET_MESSENGER_open_room (sss->msg, &key); | 115 | room = GNUNET_MESSENGER_open_room (sss->msg, &key); |
114 | 116 | ||
115 | if (!room) | 117 | if (! room) |
116 | { | 118 | { |
117 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 119 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
118 | "Testing library failed to open room with key '%s'\n", | 120 | "Testing library failed to open room with key '%s'\n", |
@@ -124,9 +126,9 @@ skip_room_state: | |||
124 | 126 | ||
125 | break; | 127 | break; |
126 | case GNUNET_MESSENGER_STAGE_JOIN_ENTER_ROOM: | 128 | case GNUNET_MESSENGER_STAGE_JOIN_ENTER_ROOM: |
127 | room = GNUNET_MESSENGER_enter_room(sss->msg, door, &key); | 129 | room = GNUNET_MESSENGER_enter_room (sss->msg, door, &key); |
128 | 130 | ||
129 | if (!room) | 131 | if (! room) |
130 | { | 132 | { |
131 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 133 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
132 | "Testing library failed to enter room with key '%s'\n", | 134 | "Testing library failed to enter room with key '%s'\n", |
@@ -143,11 +145,12 @@ skip_room_state: | |||
143 | } | 145 | } |
144 | 146 | ||
145 | jrs->room = room; | 147 | jrs->room = room; |
146 | TODO: sss->stage_index++; | 148 | TODO: sss->stage_index++; |
147 | 149 | ||
148 | GNUNET_free (door); | 150 | GNUNET_free (door); |
149 | } | 151 | } |
150 | 152 | ||
153 | |||
151 | static void | 154 | static void |
152 | join_room_cleanup (void *cls) | 155 | join_room_cleanup (void *cls) |
153 | { | 156 | { |
@@ -158,6 +161,7 @@ join_room_cleanup (void *cls) | |||
158 | GNUNET_free (jrs); | 161 | GNUNET_free (jrs); |
159 | } | 162 | } |
160 | 163 | ||
164 | |||
161 | struct GNUNET_TESTING_Command | 165 | struct GNUNET_TESTING_Command |
162 | GNUNET_MESSENGER_cmd_join_room (const char *label, | 166 | GNUNET_MESSENGER_cmd_join_room (const char *label, |
163 | const char *service_label, | 167 | const char *service_label, |
diff --git a/src/service/peerstore/peerstore_api.c b/src/service/peerstore/peerstore_api.c index 2f43db3f5..feb5aeb3c 100644 --- a/src/service/peerstore/peerstore_api.c +++ b/src/service/peerstore/peerstore_api.c | |||
@@ -540,8 +540,8 @@ GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h, | |||
540 | struct GNUNET_PEERSTORE_StoreContext *sc; | 540 | struct GNUNET_PEERSTORE_StoreContext *sc; |
541 | 541 | ||
542 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 542 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
543 | "Storing value (size: %lu) for subsystem `%s', peer `%s', key `%s'\n", | 543 | "Storing value (size: %llu) for subsystem `%s', peer `%s', key `%s'\n", |
544 | size, | 544 | (unsigned long long) size, |
545 | sub_system, | 545 | sub_system, |
546 | GNUNET_i2s (peer), | 546 | GNUNET_i2s (peer), |
547 | key); | 547 | key); |
@@ -596,7 +596,7 @@ handle_store_result (void *cls, const struct PeerstoreResultMessage *msg) | |||
596 | if (NULL == sc) | 596 | if (NULL == sc) |
597 | { | 597 | { |
598 | LOG (GNUNET_ERROR_TYPE_WARNING, | 598 | LOG (GNUNET_ERROR_TYPE_WARNING, |
599 | _("Unexpected store response.\n")); | 599 | _ ("Unexpected store response.\n")); |
600 | return; | 600 | return; |
601 | } | 601 | } |
602 | if (NULL != sc->cont) | 602 | if (NULL != sc->cont) |
@@ -673,7 +673,8 @@ handle_iterate_result (void *cls, const struct StoreRecordMessage *msg) | |||
673 | if (NULL == ic) | 673 | if (NULL == ic) |
674 | { | 674 | { |
675 | LOG (GNUNET_ERROR_TYPE_WARNING, | 675 | LOG (GNUNET_ERROR_TYPE_WARNING, |
676 | _ ("Unexpected iteration response, no iterating client found, discarding message.\n")); | 676 | _ ( |
677 | "Unexpected iteration response, no iterating client found, discarding message.\n")); | ||
677 | return; | 678 | return; |
678 | } | 679 | } |
679 | if (NULL == ic->callback) | 680 | if (NULL == ic->callback) |
@@ -857,7 +858,7 @@ reconnect (void *cls) | |||
857 | for (struct GNUNET_PEERSTORE_IterateContext *ic = h->iterate_head; NULL != ic; | 858 | for (struct GNUNET_PEERSTORE_IterateContext *ic = h->iterate_head; NULL != ic; |
858 | ic = ic->next) | 859 | ic = ic->next) |
859 | { | 860 | { |
860 | ic->rid = get_op_id(h); | 861 | ic->rid = get_op_id (h); |
861 | ev = | 862 | ev = |
862 | PEERSTORE_create_record_mq_envelope (ic->rid, | 863 | PEERSTORE_create_record_mq_envelope (ic->rid, |
863 | ic->sub_system, | 864 | ic->sub_system, |
@@ -873,7 +874,7 @@ reconnect (void *cls) | |||
873 | for (struct GNUNET_PEERSTORE_StoreContext *sc = h->store_head; NULL != sc; | 874 | for (struct GNUNET_PEERSTORE_StoreContext *sc = h->store_head; NULL != sc; |
874 | sc = sc->next) | 875 | sc = sc->next) |
875 | { | 876 | { |
876 | sc->rid = get_op_id(h); | 877 | sc->rid = get_op_id (h); |
877 | ev = | 878 | ev = |
878 | PEERSTORE_create_record_mq_envelope (sc->rid, | 879 | PEERSTORE_create_record_mq_envelope (sc->rid, |
879 | sc->sub_system, | 880 | sc->sub_system, |
diff --git a/src/service/reclaim/gnunet-service-reclaim.c b/src/service/reclaim/gnunet-service-reclaim.c index 858a86aa5..7743f85b4 100644 --- a/src/service/reclaim/gnunet-service-reclaim.c +++ b/src/service/reclaim/gnunet-service-reclaim.c | |||
@@ -21,8 +21,8 @@ | |||
21 | * @author Martin Schanzenbach | 21 | * @author Martin Schanzenbach |
22 | * @file src/reclaim/gnunet-service-reclaim.c | 22 | * @file src/reclaim/gnunet-service-reclaim.c |
23 | * @brief reclaim Service | 23 | * @brief reclaim Service |
24 | * | ||
25 | */ | 24 | */ |
25 | #include "platform.h" | ||
26 | #include "gnunet_util_lib.h" | 26 | #include "gnunet_util_lib.h" |
27 | #include "gnunet-service-reclaim_tickets.h" | 27 | #include "gnunet-service-reclaim_tickets.h" |
28 | #include "gnunet_gnsrecord_lib.h" | 28 | #include "gnunet_gnsrecord_lib.h" |
@@ -2518,7 +2518,7 @@ ticket_iter_cb (void *cls, struct GNUNET_RECLAIM_Ticket *ticket) | |||
2518 | trm->id = htonl (ti->r_id); | 2518 | trm->id = htonl (ti->r_id); |
2519 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending TICKET_RESULT message\n"); | 2519 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending TICKET_RESULT message\n"); |
2520 | trm->tkt_len = htons (tkt_len); | 2520 | trm->tkt_len = htons (tkt_len); |
2521 | trm->presentations_len = htons(0); | 2521 | trm->presentations_len = htons (0); |
2522 | GNUNET_MQ_send (ti->client->mq, env); | 2522 | GNUNET_MQ_send (ti->client->mq, env); |
2523 | if (NULL == ticket) | 2523 | if (NULL == ticket) |
2524 | GNUNET_free (ti); | 2524 | GNUNET_free (ti); |
diff --git a/src/service/regex/regex_internal_dht.c b/src/service/regex/regex_internal_dht.c index 9850f106f..48850f87f 100644 --- a/src/service/regex/regex_internal_dht.c +++ b/src/service/regex/regex_internal_dht.c | |||
@@ -530,13 +530,15 @@ regex_result_iterator (void *cls, | |||
530 | return GNUNET_YES; // We found an accept state! | 530 | return GNUNET_YES; // We found an accept state! |
531 | } | 531 | } |
532 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 532 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
533 | "* %lu, %lu, [%u]\n", | 533 | "* %llu, %llu, [%u]\n", |
534 | (unsigned long) ctx->position, | 534 | (unsigned long long) ctx->position, |
535 | strlen (ctx->info->description), | 535 | (unsigned long long) strlen (ctx->info->description), |
536 | GNUNET_BLOCK_is_accepting (block, result->size)); | 536 | GNUNET_BLOCK_is_accepting (block, |
537 | result->size)); | ||
537 | regex_next_edge (block, result->size, ctx); | 538 | regex_next_edge (block, result->size, ctx); |
538 | 539 | ||
539 | GNUNET_STATISTICS_update (ctx->info->stats, "# regex cadet blocks iterated", | 540 | GNUNET_STATISTICS_update (ctx->info->stats, |
541 | "# regex cadet blocks iterated", | ||
540 | 1, GNUNET_NO); | 542 | 1, GNUNET_NO); |
541 | 543 | ||
542 | return GNUNET_YES; | 544 | return GNUNET_YES; |
diff --git a/src/service/testing/gnunet-cmds-helper.c b/src/service/testing/gnunet-cmds-helper.c index d262955cb..a54191abf 100644 --- a/src/service/testing/gnunet-cmds-helper.c +++ b/src/service/testing/gnunet-cmds-helper.c | |||
@@ -658,8 +658,8 @@ main (int argc, char **argv) | |||
658 | for (i = 6; i<argc; i++) | 658 | for (i = 6; i<argc; i++) |
659 | topology_data_length += strlen (argv[i]) + 1; | 659 | topology_data_length += strlen (argv[i]) + 1; |
660 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 660 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
661 | "topo data length %lu\n", | 661 | "topo data length %llu\n", |
662 | topology_data_length); | 662 | (unsigned long long) topology_data_length); |
663 | ni->topology_data = GNUNET_malloc (topology_data_length); | 663 | ni->topology_data = GNUNET_malloc (topology_data_length); |
664 | memset (ni->topology_data, '\0', topology_data_length); | 664 | memset (ni->topology_data, '\0', topology_data_length); |
665 | for (i = 6; i<argc; i++) | 665 | for (i = 6; i<argc; i++) |
diff --git a/src/service/transport/gnunet-communicator-udp.c b/src/service/transport/gnunet-communicator-udp.c index d02043908..29beb4e37 100644 --- a/src/service/transport/gnunet-communicator-udp.c +++ b/src/service/transport/gnunet-communicator-udp.c | |||
@@ -67,7 +67,7 @@ | |||
67 | * How often do we scan for changes to our network interfaces? | 67 | * How often do we scan for changes to our network interfaces? |
68 | */ | 68 | */ |
69 | #define INTERFACE_SCAN_FREQUENCY \ | 69 | #define INTERFACE_SCAN_FREQUENCY \ |
70 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) | 70 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * How long do we believe our addresses to remain up (before | 73 | * How long do we believe our addresses to remain up (before |
@@ -76,7 +76,7 @@ | |||
76 | #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS | 76 | #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS |
77 | 77 | ||
78 | #define WORKING_QUEUE_INTERVALL \ | 78 | #define WORKING_QUEUE_INTERVALL \ |
79 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) | 79 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * AES key size. | 82 | * AES key size. |
@@ -1611,8 +1611,8 @@ try_handle_plaintext (struct SenderAddress *sender, | |||
1611 | return; /* no data left */ | 1611 | return; /* no data left */ |
1612 | } | 1612 | } |
1613 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1613 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1614 | "try_handle_plaintext of size %lu (%u %lu) and type %u\n", | 1614 | "try_handle_plaintext of size %llu (%u %lu) and type %u\n", |
1615 | bytes_remaining, | 1615 | (unsigned long long) bytes_remaining, |
1616 | ntohs (hdr->size), | 1616 | ntohs (hdr->size), |
1617 | sizeof(*hdr), | 1617 | sizeof(*hdr), |
1618 | ntohs (hdr->type)); | 1618 | ntohs (hdr->type)); |
@@ -1947,16 +1947,17 @@ sock_read (void *cls) | |||
1947 | if (EAGAIN == errno) | 1947 | if (EAGAIN == errno) |
1948 | break; // We are done reading data | 1948 | break; // We are done reading data |
1949 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1949 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1950 | "Failed to recv from %s family %d failed sock %p\n", | 1950 | "Failed to recv from %s family %d failed sock %p\n", |
1951 | GNUNET_a2s ((struct sockaddr*) &sa, | 1951 | GNUNET_a2s ((struct sockaddr*) &sa, |
1952 | sizeof (addr)), | 1952 | sizeof (addr)), |
1953 | addr->sa_family, | 1953 | addr->sa_family, |
1954 | udp_sock); | 1954 | udp_sock); |
1955 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "recv"); | 1955 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "recv"); |
1956 | return; | 1956 | return; |
1957 | } | 1957 | } |
1958 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1958 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1959 | "Read %lu bytes\n", rcvd); | 1959 | "Read %llu bytes\n", |
1960 | (unsigned long long) rcvd); | ||
1960 | if (0 == rcvd) | 1961 | if (0 == rcvd) |
1961 | { | 1962 | { |
1962 | GNUNET_break_op (0); | 1963 | GNUNET_break_op (0); |
@@ -2383,12 +2384,12 @@ send_msg_with_kx (const struct GNUNET_MessageHeader *msg, struct | |||
2383 | { | 2384 | { |
2384 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); | 2385 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); |
2385 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2386 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2386 | "Sending KX with payload size %u to %s family %d failed sock %p\n", | 2387 | "Sending KX with payload size %u to %s family %d failed sock %p\n", |
2387 | msize, | 2388 | msize, |
2388 | GNUNET_a2s (receiver->address, | 2389 | GNUNET_a2s (receiver->address, |
2389 | receiver->address_len), | 2390 | receiver->address_len), |
2390 | receiver->address->sa_family, | 2391 | receiver->address->sa_family, |
2391 | udp_sock); | 2392 | udp_sock); |
2392 | GNUNET_MQ_impl_send_continue (mq); | 2393 | GNUNET_MQ_impl_send_continue (mq); |
2393 | receiver_destroy (receiver); | 2394 | receiver_destroy (receiver); |
2394 | return; | 2395 | return; |
@@ -2470,9 +2471,9 @@ mq_send_d (struct GNUNET_MQ_Handle *mq, | |||
2470 | (0 == receiver->acks_available)) | 2471 | (0 == receiver->acks_available)) |
2471 | { | 2472 | { |
2472 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2473 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2473 | "msize: %u, mtu: %lu, acks: %u\n", | 2474 | "msize: %u, mtu: %llu, acks: %u\n", |
2474 | msize, | 2475 | (unsigned int) msize, |
2475 | receiver->d_mtu, | 2476 | (unsigned long long) receiver->d_mtu, |
2476 | receiver->acks_available); | 2477 | receiver->acks_available); |
2477 | 2478 | ||
2478 | GNUNET_break (0); | 2479 | GNUNET_break (0); |
@@ -2562,11 +2563,11 @@ mq_send_d (struct GNUNET_MQ_Handle *mq, | |||
2562 | { | 2563 | { |
2563 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); | 2564 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); |
2564 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2565 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2565 | "Sending UDPBox to %s family %d failed sock %p failed\n", | 2566 | "Sending UDPBox to %s family %d failed sock %p failed\n", |
2566 | GNUNET_a2s (receiver->address, | 2567 | GNUNET_a2s (receiver->address, |
2567 | receiver->address_len), | 2568 | receiver->address_len), |
2568 | receiver->address->sa_family, | 2569 | receiver->address->sa_family, |
2569 | udp_sock); | 2570 | udp_sock); |
2570 | receiver_destroy (receiver); | 2571 | receiver_destroy (receiver); |
2571 | return; | 2572 | return; |
2572 | } | 2573 | } |
diff --git a/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c b/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c index f15311882..33deb3323 100644 --- a/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c +++ b/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c | |||
@@ -115,7 +115,7 @@ handle_test (void *cls, | |||
115 | 115 | ||
116 | 116 | ||
117 | GNUNET_TRANSPORT_TESTING_get_trait_state (&start_peer, | 117 | GNUNET_TRANSPORT_TESTING_get_trait_state (&start_peer, |
118 | &sps); | 118 | &sps); |
119 | ch = sps->th; | 119 | ch = sps->th; |
120 | num = ntohl (message->num); | 120 | num = ntohl (message->num); |
121 | GNUNET_TESTING_get_trait_async_context (&block_receive, | 121 | GNUNET_TESTING_get_trait_async_context (&block_receive, |
@@ -165,12 +165,12 @@ handle_test (void *cls, | |||
165 | sender->num_received++; | 165 | sender->num_received++; |
166 | 166 | ||
167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
168 | "time traveled: %lu\n", | 168 | "time traveled: %llu\n", |
169 | time_traveled.rel_value_us); | 169 | (unsigned long long) time_traveled.rel_value_us); |
170 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 170 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
171 | "mean time traveled: %s %llu messages received with message number %u\n", | 171 | "mean time traveled: %s %llu messages received with message number %u\n", |
172 | GNUNET_STRINGS_relative_time_to_string (sender->mean_time, | 172 | GNUNET_STRINGS_relative_time_to_string (sender->mean_time, |
173 | GNUNET_NO), | 173 | false), |
174 | sender->num_received, | 174 | sender->num_received, |
175 | num); | 175 | num); |
176 | if (floor (MAX_RECEIVED * (1 - 1.0 / 200)) < sender->num_received && NULL == | 176 | if (floor (MAX_RECEIVED * (1 - 1.0 / 200)) < sender->num_received && NULL == |
@@ -255,7 +255,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
255 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 255 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
256 | "connect-peers"); | 256 | "connect-peers"); |
257 | GNUNET_TRANSPORT_TESTING_get_trait_connect_peer_state (cmd, | 257 | GNUNET_TRANSPORT_TESTING_get_trait_connect_peer_state (cmd, |
258 | &cps); | 258 | &cps); |
259 | void *ret = NULL; | 259 | void *ret = NULL; |
260 | 260 | ||
261 | cps->notify_connect (is, | 261 | cps->notify_connect (is, |