diff options
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r-- | src/transport/gnunet-transport.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 1dc85a903..58d20e16d 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c | |||
@@ -150,6 +150,7 @@ struct TestContext | |||
150 | 150 | ||
151 | }; | 151 | }; |
152 | 152 | ||
153 | struct GNUNET_CONFIGURATION_Handle * cfg; | ||
153 | 154 | ||
154 | /** | 155 | /** |
155 | * Display the result of the test. | 156 | * Display the result of the test. |
@@ -432,6 +433,11 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
432 | traffic_received += ntohs (message->size); | 433 | traffic_received += ntohs (message->size); |
433 | } | 434 | } |
434 | 435 | ||
436 | void process_string (void *cls, | ||
437 | const char *address) | ||
438 | { | ||
439 | fprintf (stdout, _("process_string\n")); | ||
440 | } | ||
435 | 441 | ||
436 | /** | 442 | /** |
437 | * Function to call with a human-readable format of an address | 443 | * Function to call with a human-readable format of an address |
@@ -445,23 +451,23 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
445 | static void | 451 | static void |
446 | process_address (void *cls, const struct GNUNET_HELLO_Address *address) | 452 | process_address (void *cls, const struct GNUNET_HELLO_Address *address) |
447 | { | 453 | { |
448 | if ((address->transport_name != NULL) || | 454 | if (address == NULL) |
449 | ((address->address != NULL) && (address->address_length > 0))) | ||
450 | { | 455 | { |
451 | /* Call GNUNET_TRANSPORT_address_to_string to convert to human readable */ | 456 | return; |
452 | //GNUNET_TRANSPORT_address_to_string(cfg, address, GNUNET_NO) | ||
453 | |||
454 | #if 0 | ||
455 | fprintf (stdout, _("Peer `%s' plugin: `%s' address `%s'\n"), | ||
456 | (peer != NULL) ? GNUNET_i2s (peer) : "<unknown>", | ||
457 | (transport != NULL) ? transport : "<unknown>", ((addr != NULL) && | ||
458 | (addrlen > 0) && | ||
459 | (transport != | ||
460 | NULL)) ? | ||
461 | "how do i resolve the name without transport service?" : | ||
462 | "<unknown>"); | ||
463 | #endif | ||
464 | } | 457 | } |
458 | |||
459 | fprintf (stdout, _("Peer `%s'\n"), | ||
460 | GNUNET_i2s (&address->peer)); | ||
461 | |||
462 | /* Resolve address to string */ | ||
463 | /* | ||
464 | GNUNET_TRANSPORT_address_to_string (cfg, | ||
465 | address, | ||
466 | GNUNET_NO, | ||
467 | GNUNET_TIME_UNIT_MINUTES, | ||
468 | &process_string, | ||
469 | NULL); | ||
470 | */ | ||
465 | } | 471 | } |
466 | 472 | ||
467 | 473 | ||
@@ -477,6 +483,7 @@ static void | |||
477 | run (void *cls, char *const *args, const char *cfgfile, | 483 | run (void *cls, char *const *args, const char *cfgfile, |
478 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 484 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
479 | { | 485 | { |
486 | cfg = cfg; | ||
480 | if (test_configuration) | 487 | if (test_configuration) |
481 | { | 488 | { |
482 | do_test_configuration (cfg); | 489 | do_test_configuration (cfg); |