diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-13 12:37:20 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-13 12:37:20 +0000 |
commit | 1ed0918fbadb6fe57c6797e4bc9478e211d71cfa (patch) | |
tree | 8a2a5f1a3844557ff3b5237e2c849f8582dbfc37 /src/transport/gnunet-service-transport.c | |
parent | 1ccdc610f0a349b48bf1e9697b8543268a2cfd1b (diff) | |
download | gnunet-1ed0918fbadb6fe57c6797e4bc9478e211d71cfa.tar.gz gnunet-1ed0918fbadb6fe57c6797e4bc9478e211d71cfa.zip |
warning if inbound session does not have address length 0
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 6291266f6..7d385dd41 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -523,6 +523,19 @@ plugin_env_update_metrics (void *cls, | |||
523 | GST_ats_update_metrics (peer, &haddress, session, ats, ats_count); | 523 | GST_ats_update_metrics (peer, &haddress, session, ats, ats_count); |
524 | } | 524 | } |
525 | 525 | ||
526 | /** | ||
527 | * Plugin tells transport service about a new (inbound) session | ||
528 | * | ||
529 | * @param cls unused | ||
530 | * @param peer the peer | ||
531 | * @param plugin plugin name | ||
532 | * @param address address | ||
533 | * @param address_len address length | ||
534 | * @param session the new session | ||
535 | * @param ats ats information | ||
536 | * @param ats_count number of ats information | ||
537 | */ | ||
538 | |||
526 | static void | 539 | static void |
527 | plugin_env_session_start (void *cls, | 540 | plugin_env_session_start (void *cls, |
528 | const struct GNUNET_PeerIdentity *peer, | 541 | const struct GNUNET_PeerIdentity *peer, |
@@ -533,6 +546,7 @@ plugin_env_session_start (void *cls, | |||
533 | const struct GNUNET_ATS_Information *ats, | 546 | const struct GNUNET_ATS_Information *ats, |
534 | uint32_t ats_count) | 547 | uint32_t ats_count) |
535 | { | 548 | { |
549 | struct GNUNET_HELLO_Address *addr; | ||
536 | if (NULL == peer) | 550 | if (NULL == peer) |
537 | { | 551 | { |
538 | GNUNET_break (0); | 552 | GNUNET_break (0); |
@@ -554,8 +568,13 @@ plugin_env_session_start (void *cls, | |||
554 | return; | 568 | return; |
555 | } | 569 | } |
556 | 570 | ||
557 | struct GNUNET_HELLO_Address *addr; | ||
558 | addr = GNUNET_HELLO_address_allocate (peer, plugin, address, address_len); | 571 | addr = GNUNET_HELLO_address_allocate (peer, plugin, address, address_len); |
572 | if (0 != address_len) | ||
573 | { | ||
574 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
575 | "Inbound session from plugin `%s' about new session %p from peer `%s' address `%s' does not have address length 0 but %u\n", | ||
576 | plugin, session, GNUNET_i2s (peer), GST_plugins_a2s(addr), address_len); | ||
577 | } | ||
559 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 578 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
560 | "Notification from plugin `%s' about new session %p from peer `%s' address `%s'\n", | 579 | "Notification from plugin `%s' about new session %p from peer `%s' address `%s'\n", |
561 | plugin, session, GNUNET_i2s (peer), GST_plugins_a2s(addr)); | 580 | plugin, session, GNUNET_i2s (peer), GST_plugins_a2s(addr)); |