diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-18 16:11:03 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-18 16:11:03 +0000 |
commit | f68c5e63c9bf905e125f449eaa66d9969f74838c (patch) | |
tree | 1de49b904a763b8c44e8f02d7730e21821feeffc /src/dv/dv_api.c | |
parent | ab728fdf2db6f2b8cef37d0c6add760c88acd526 (diff) | |
download | gnunet-f68c5e63c9bf905e125f449eaa66d9969f74838c.tar.gz gnunet-f68c5e63c9bf905e125f449eaa66d9969f74838c.zip |
dv changes, better logging and so on
Diffstat (limited to 'src/dv/dv_api.c')
-rw-r--r-- | src/dv/dv_api.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c index 25905828b..12801dcd7 100644 --- a/src/dv/dv_api.c +++ b/src/dv/dv_api.c | |||
@@ -345,10 +345,6 @@ void handle_message_receipt (void *cls, | |||
345 | GNUNET_HashCode uidhash; | 345 | GNUNET_HashCode uidhash; |
346 | struct SendCallbackContext *send_ctx; | 346 | struct SendCallbackContext *send_ctx; |
347 | 347 | ||
348 | #if DEBUG_DV | ||
349 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "dv api receives message!\n"); | ||
350 | #endif | ||
351 | |||
352 | if (msg == NULL) | 348 | if (msg == NULL) |
353 | { | 349 | { |
354 | return; /* Connection closed? */ | 350 | return; /* Connection closed? */ |
@@ -367,9 +363,6 @@ void handle_message_receipt (void *cls, | |||
367 | sender_address_len = ntohl(received_msg->sender_address_len); | 363 | sender_address_len = ntohl(received_msg->sender_address_len); |
368 | 364 | ||
369 | GNUNET_assert(ntohs(msg->size) == (sizeof(struct GNUNET_DV_MessageReceived) + packed_msg_len + sender_address_len)); | 365 | GNUNET_assert(ntohs(msg->size) == (sizeof(struct GNUNET_DV_MessageReceived) + packed_msg_len + sender_address_len)); |
370 | #if DEBUG_DV | ||
371 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "dv api receives message, size checks out!\n"); | ||
372 | #endif | ||
373 | sender_address = GNUNET_malloc(sender_address_len); | 366 | sender_address = GNUNET_malloc(sender_address_len); |
374 | memcpy(sender_address, &received_msg[1], sender_address_len); | 367 | memcpy(sender_address, &received_msg[1], sender_address_len); |
375 | packed_msg_start = (char *)&received_msg[1]; | 368 | packed_msg_start = (char *)&received_msg[1]; |
@@ -399,13 +392,9 @@ void handle_message_receipt (void *cls, | |||
399 | send_result_msg = (struct GNUNET_DV_SendResultMessage *)msg; | 392 | send_result_msg = (struct GNUNET_DV_SendResultMessage *)msg; |
400 | hash_from_uid(ntohl(send_result_msg->uid), &uidhash); | 393 | hash_from_uid(ntohl(send_result_msg->uid), &uidhash); |
401 | send_ctx = GNUNET_CONTAINER_multihashmap_get(handle->send_callbacks, &uidhash); | 394 | send_ctx = GNUNET_CONTAINER_multihashmap_get(handle->send_callbacks, &uidhash); |
402 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "got uid of %u or %u, hash of %s !!!!\n", ntohl(send_result_msg->uid), send_result_msg->uid, GNUNET_h2s(&uidhash)); | ||
403 | 395 | ||
404 | if ((send_ctx != NULL) && (send_ctx->cont != NULL)) | 396 | if ((send_ctx != NULL) && (send_ctx->cont != NULL)) |
405 | { | 397 | { |
406 | #if DEBUG_DV | ||
407 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "dv api notifies transport of send result (%u)!\n", ntohl(send_result_msg->result)); | ||
408 | #endif | ||
409 | if (ntohl(send_result_msg->result) == 0) | 398 | if (ntohl(send_result_msg->result) == 0) |
410 | { | 399 | { |
411 | send_ctx->cont(send_ctx->cont_cls, &send_ctx->target, GNUNET_OK); | 400 | send_ctx->cont(send_ctx->cont_cls, &send_ctx->target, GNUNET_OK); |
@@ -458,7 +447,6 @@ int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, | |||
458 | GNUNET_HashCode uidhash; | 447 | GNUNET_HashCode uidhash; |
459 | #if DEBUG_DV_MESSAGES | 448 | #if DEBUG_DV_MESSAGES |
460 | dv_handle->uid_gen = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG, UINT32_MAX); | 449 | dv_handle->uid_gen = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG, UINT32_MAX); |
461 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "GNUNET_DV_send called with message of size %d, address size %d, total size %d, uid %u\n", msgbuf_size, addrlen, sizeof(struct GNUNET_DV_SendMessage) + msgbuf_size + addrlen, dv_handle->uid_gen); | ||
462 | #else | 450 | #else |
463 | dv_handle->uid_gen++; | 451 | dv_handle->uid_gen++; |
464 | #endif | 452 | #endif |