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/test_transport_api_dv.c | |
parent | ab728fdf2db6f2b8cef37d0c6add760c88acd526 (diff) | |
download | gnunet-f68c5e63c9bf905e125f449eaa66d9969f74838c.tar.gz gnunet-f68c5e63c9bf905e125f449eaa66d9969f74838c.zip |
dv changes, better logging and so on
Diffstat (limited to 'src/dv/test_transport_api_dv.c')
-rw-r--r-- | src/dv/test_transport_api_dv.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index fdf3ba2df..e0d956e86 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c | |||
@@ -296,12 +296,13 @@ process_mtype (void *cls, | |||
296 | if (pos->uid != ntohl(msg->uid)) | 296 | if (pos->uid != ntohl(msg->uid)) |
297 | return GNUNET_OK; | 297 | return GNUNET_OK; |
298 | 298 | ||
299 | GNUNET_assert(0 == memcmp(peer, &pos->peer1->id, sizeof(struct GNUNET_PeerIdentity))); | ||
299 | if (total_other_expected_messages == 0) | 300 | if (total_other_expected_messages == 0) |
300 | { | 301 | { |
301 | total_messages_received++; | 302 | total_messages_received++; |
302 | #if VERBOSE | 303 | #if VERBOSE |
303 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 304 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
304 | "Received message from `%4s', type %d, distance %u.\n", GNUNET_i2s (peer), ntohs(message->type), distance); | 305 | "Received message from `%4s', type %d, uid %u, distance %u.\n", GNUNET_i2s (peer), ntohs(message->type), ntohl(msg->uid), distance); |
305 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 306 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
306 | "Total messages received %d, expected %d.\n", total_messages_received, expected_messages); | 307 | "Total messages received %d, expected %d.\n", total_messages_received, expected_messages); |
307 | #endif | 308 | #endif |
@@ -311,7 +312,7 @@ process_mtype (void *cls, | |||
311 | total_other_messages++; | 312 | total_other_messages++; |
312 | #if VERBOSE | 313 | #if VERBOSE |
313 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 314 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
314 | "Received message from `%4s', type %d, distance %u.\n", GNUNET_i2s (peer), ntohs(message->type), distance); | 315 | "Received message from `%4s', type %d, uid %u, distance %u.\n", GNUNET_i2s (peer), ntohs(message->type), ntohl(msg->uid), distance); |
315 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 316 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
316 | "Total messages received %d, expected %d.\n", total_other_messages, total_other_expected_messages); | 317 | "Total messages received %d, expected %d.\n", total_other_messages, total_other_expected_messages); |
317 | #endif | 318 | #endif |
@@ -320,7 +321,7 @@ process_mtype (void *cls, | |||
320 | if ((total_messages_received == expected_messages) && (total_other_messages == 0)) | 321 | if ((total_messages_received == expected_messages) && (total_other_messages == 0)) |
321 | { | 322 | { |
322 | GNUNET_SCHEDULER_cancel (sched, die_task); | 323 | GNUNET_SCHEDULER_cancel (sched, die_task); |
323 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 40), &send_other_messages, NULL); | 324 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45), &send_other_messages, NULL); |
324 | } | 325 | } |
325 | else if ((total_other_expected_messages > 0) && (total_other_messages == total_other_expected_messages)) | 326 | else if ((total_other_expected_messages > 0) && (total_other_messages == total_other_expected_messages)) |
326 | { | 327 | { |
@@ -801,7 +802,7 @@ static void all_connect_handler (void *cls, | |||
801 | temp_context->peer1 = d; | 802 | temp_context->peer1 = d; |
802 | temp_context->peer2 = second_daemon; | 803 | temp_context->peer2 = second_daemon; |
803 | temp_context->next = other_test_messages; | 804 | temp_context->next = other_test_messages; |
804 | temp_context->uid = total_connections; | 805 | temp_context->uid = total_connections + temp_total_other_messages; |
805 | temp_context->disconnect_task = GNUNET_SCHEDULER_NO_TASK; | 806 | temp_context->disconnect_task = GNUNET_SCHEDULER_NO_TASK; |
806 | other_test_messages = temp_context; | 807 | other_test_messages = temp_context; |
807 | } | 808 | } |
@@ -818,6 +819,8 @@ static void all_connect_handler (void *cls, | |||
818 | fprintf(dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname, second_shortname); | 819 | fprintf(dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname, second_shortname); |
819 | else if (distance == 4) | 820 | else if (distance == 4) |
820 | fprintf(dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname, second_shortname); | 821 | fprintf(dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname, second_shortname); |
822 | else | ||
823 | fprintf(dotOutFile, "\tn%s -- n%s [color=brown];\n", d->shortname, second_shortname); | ||
821 | } | 824 | } |
822 | GNUNET_free(second_shortname); | 825 | GNUNET_free(second_shortname); |
823 | } | 826 | } |