diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-27 18:52:43 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-27 18:52:43 +0000 |
commit | 535f25a46ffa5c535f1b01b87e14a42261580425 (patch) | |
tree | da3ff7b5e0afd2f175477bad7c83ee8dd710bc19 /src | |
parent | 6b82853eec7bac44bb43bb13c39754fb2162d64d (diff) | |
download | gnunet-535f25a46ffa5c535f1b01b87e14a42261580425.tar.gz gnunet-535f25a46ffa5c535f1b01b87e14a42261580425.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours_fsm.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours_fsm.c b/src/transport/gnunet-service-transport_neighbours_fsm.c index 6923ae1e7..fd3ad37f9 100644 --- a/src/transport/gnunet-service-transport_neighbours_fsm.c +++ b/src/transport/gnunet-service-transport_neighbours_fsm.c | |||
@@ -427,7 +427,7 @@ change (struct NeighbourMapEntry * n, int state, int line) | |||
427 | break; | 427 | break; |
428 | case S_CONNECT_SENT: | 428 | case S_CONNECT_SENT: |
429 | if ((state == S_NOT_CONNECTED) || (state == S_CONNECTED) || | 429 | if ((state == S_NOT_CONNECTED) || (state == S_CONNECTED) || |
430 | (state == S_DISCONNECT)) | 430 | (state == S_DISCONNECT) || /* FIXME SENT -> RECV ISSUE!*/ (state == S_CONNECT_RECV)) |
431 | { | 431 | { |
432 | allowed = GNUNET_YES; | 432 | allowed = GNUNET_YES; |
433 | break; | 433 | break; |
@@ -1178,7 +1178,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | |||
1178 | return GNUNET_NO; | 1178 | return GNUNET_NO; |
1179 | } | 1179 | } |
1180 | 1180 | ||
1181 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Invalid connection state to switch addresses "); | 1181 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Invalid connection state to switch addresses %u ", n->state); |
1182 | GNUNET_break_op (0); | 1182 | GNUNET_break_op (0); |
1183 | return GNUNET_NO; | 1183 | return GNUNET_NO; |
1184 | } | 1184 | } |
@@ -1753,9 +1753,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
1753 | size_t ret; | 1753 | size_t ret; |
1754 | 1754 | ||
1755 | #if DEBUG_TRANSPORT | 1755 | #if DEBUG_TRANSPORT |
1756 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1757 | "Received CONNECT_ACK message from peer `%s'\n", GNUNET_i2s (peer)); | ||
1758 | #endif | 1756 | #endif |
1757 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1758 | "Received CONNECT_ACK message from peer `%s'\n", GNUNET_i2s (peer)); | ||
1759 | |||
1759 | 1760 | ||
1760 | if (ntohs (message->size) != sizeof (struct SessionConnectMessage)) | 1761 | if (ntohs (message->size) != sizeof (struct SessionConnectMessage)) |
1761 | { | 1762 | { |
@@ -1769,14 +1770,14 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
1769 | n = lookup_neighbour (peer); | 1770 | n = lookup_neighbour (peer); |
1770 | if (NULL == n) | 1771 | if (NULL == n) |
1771 | n = setup_neighbour (peer); | 1772 | n = setup_neighbour (peer); |
1772 | 1773 | /* | |
1773 | if (n->state != S_CONNECT_SENT) | 1774 | if (n->state != S_CONNECT_SENT) |
1774 | { | 1775 | { |
1775 | GNUNET_break (0); | 1776 | GNUNET_break (0); |
1776 | send_disconnect(n); | 1777 | send_disconnect(n); |
1777 | return; | 1778 | return; |
1778 | } | 1779 | } |
1779 | 1780 | */ | |
1780 | if (NULL != session) | 1781 | if (NULL != session) |
1781 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 1782 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
1782 | "transport-ats", | 1783 | "transport-ats", |
@@ -1866,8 +1867,9 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, | |||
1866 | send_disconnect(n); | 1867 | send_disconnect(n); |
1867 | GNUNET_break (0); | 1868 | GNUNET_break (0); |
1868 | } | 1869 | } |
1869 | 1870 | // FIXME check this | |
1870 | if (n->state != S_CONNECT_RECV) | 1871 | // if (n->state != S_CONNECT_RECV) |
1872 | if (is_connecting(n)) | ||
1871 | { | 1873 | { |
1872 | send_disconnect (n); | 1874 | send_disconnect (n); |
1873 | change_state (n, S_DISCONNECT); | 1875 | change_state (n, S_DISCONNECT); |
@@ -1976,9 +1978,11 @@ handle_connect_blacklist_cont (void *cls, | |||
1976 | } | 1978 | } |
1977 | 1979 | ||
1978 | GNUNET_free (bcc); | 1980 | GNUNET_free (bcc); |
1979 | 1981 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | |
1982 | "Blacklist check due to CONNECT message: `%s'\n"); | ||
1983 | /* | ||
1980 | if (n->state != S_NOT_CONNECTED) | 1984 | if (n->state != S_NOT_CONNECTED) |
1981 | return; | 1985 | return;*/ |
1982 | change_state (n, S_CONNECT_RECV); | 1986 | change_state (n, S_CONNECT_RECV); |
1983 | 1987 | ||
1984 | /* Ask ATS for an address to connect via that address */ | 1988 | /* Ask ATS for an address to connect via that address */ |
@@ -2013,9 +2017,10 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, | |||
2013 | struct BlackListCheckContext * bcc = NULL; | 2017 | struct BlackListCheckContext * bcc = NULL; |
2014 | 2018 | ||
2015 | #if DEBUG_TRANSPORT | 2019 | #if DEBUG_TRANSPORT |
2016 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2017 | "Received CONNECT message from peer `%s'\n", GNUNET_i2s (peer)); | ||
2018 | #endif | 2020 | #endif |
2021 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
2022 | "Received CONNECT message from peer `%s'\n", GNUNET_i2s (peer)); | ||
2023 | |||
2019 | 2024 | ||
2020 | if (ntohs (message->size) != sizeof (struct SessionConnectMessage)) | 2025 | if (ntohs (message->size) != sizeof (struct SessionConnectMessage)) |
2021 | { | 2026 | { |