diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-26 13:16:49 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-26 13:16:49 +0000 |
commit | 151cacabd28ce4b171e833db6651321c13af8f22 (patch) | |
tree | 36169401b59d92eeed56928a282b163afef48328 | |
parent | a540dba8d2abd13ba6552b0d6081c4c11e95eb31 (diff) | |
download | gnunet-151cacabd28ce4b171e833db6651321c13af8f22.tar.gz gnunet-151cacabd28ce4b171e833db6651321c13af8f22.zip |
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours_fsm.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours_fsm.c b/src/transport/gnunet-service-transport_neighbours_fsm.c index 8759eff08..e149facd0 100644 --- a/src/transport/gnunet-service-transport_neighbours_fsm.c +++ b/src/transport/gnunet-service-transport_neighbours_fsm.c | |||
@@ -975,6 +975,14 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | |||
975 | size_t len; | 975 | size_t len; |
976 | size_t ret; | 976 | size_t ret; |
977 | 977 | ||
978 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
979 | "SWITCH! Peer `%4s' switches to plugin `%s' address '%s' session %X\n", | ||
980 | GNUNET_i2s (peer), plugin_name, | ||
981 | (address_len == 0) ? "<inbound>" : GST_plugins_a2s (plugin_name, | ||
982 | address, | ||
983 | address_len), | ||
984 | session); | ||
985 | |||
978 | GNUNET_assert (neighbours != NULL); | 986 | GNUNET_assert (neighbours != NULL); |
979 | n = lookup_neighbour (peer); | 987 | n = lookup_neighbour (peer); |
980 | if (NULL == n) | 988 | if (NULL == n) |
@@ -987,7 +995,9 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | |||
987 | return GNUNET_NO; | 995 | return GNUNET_NO; |
988 | } | 996 | } |
989 | 997 | ||
990 | change_state (n, S_CONNECT_SENT); | 998 | // FIXME state transition when peer is connected? |
999 | if (!is_connected(n)) | ||
1000 | change_state (n, S_CONNECT_SENT); | ||
991 | 1001 | ||
992 | #if DEBUG_TRANSPORT | 1002 | #if DEBUG_TRANSPORT |
993 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1003 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1643,6 +1653,19 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
1643 | send_disconnect(n); | 1653 | send_disconnect(n); |
1644 | return; | 1654 | return; |
1645 | } | 1655 | } |
1656 | |||
1657 | if (NULL != session) | ||
1658 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | ||
1659 | "transport-ats", | ||
1660 | "Giving ATS session %p of plugin %s for peer %s\n", | ||
1661 | session, | ||
1662 | plugin_name, | ||
1663 | GNUNET_i2s (peer)); | ||
1664 | GNUNET_ATS_address_update (GST_ats, | ||
1665 | peer, | ||
1666 | plugin_name, sender_address, sender_address_len, | ||
1667 | session, ats, ats_count); | ||
1668 | |||
1646 | neighbour_connected (n, ats, ats_count, GNUNET_YES); | 1669 | neighbour_connected (n, ats, ats_count, GNUNET_YES); |
1647 | } | 1670 | } |
1648 | 1671 | ||
@@ -1681,6 +1704,18 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, | |||
1681 | if (is_connected(n)) | 1704 | if (is_connected(n)) |
1682 | return; | 1705 | return; |
1683 | 1706 | ||
1707 | if (NULL != session) | ||
1708 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | ||
1709 | "transport-ats", | ||
1710 | "Giving ATS session %p of plugin %s for peer %s\n", | ||
1711 | session, | ||
1712 | plugin_name, | ||
1713 | GNUNET_i2s (peer)); | ||
1714 | GNUNET_ATS_address_update (GST_ats, | ||
1715 | peer, | ||
1716 | plugin_name, sender_address, sender_address_len, | ||
1717 | session, ats, ats_count); | ||
1718 | |||
1684 | neighbour_connected (n, ats, ats_count, GNUNET_NO); | 1719 | neighbour_connected (n, ats, ats_count, GNUNET_NO); |
1685 | } | 1720 | } |
1686 | 1721 | ||
@@ -1759,7 +1794,7 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, | |||
1759 | if (ts.abs_value > n->connect_ts.abs_value) | 1794 | if (ts.abs_value > n->connect_ts.abs_value) |
1760 | { | 1795 | { |
1761 | if (NULL != session) | 1796 | if (NULL != session) |
1762 | GNUNET_log_from (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK, | 1797 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, |
1763 | "transport-ats", | 1798 | "transport-ats", |
1764 | "Giving ATS session %p of plugin %s for peer %s\n", | 1799 | "Giving ATS session %p of plugin %s for peer %s\n", |
1765 | session, | 1800 | session, |