diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-25 18:31:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-25 18:31:13 +0000 |
commit | 9b277b54e35f9a8beb0f55b8824fd7eb973b1ec2 (patch) | |
tree | c605c2dc2ddfd6d79ad8cb9301c2488ab53bc782 /src/transport/gnunet-service-transport_neighbours.c | |
parent | dd5c5752d74e1080ce076c68c887e6431b6f9051 (diff) | |
download | gnunet-9b277b54e35f9a8beb0f55b8824fd7eb973b1ec2.tar.gz gnunet-9b277b54e35f9a8beb0f55b8824fd7eb973b1ec2.zip |
-LRN: reverting earlier attempt to fix LRN's NAT connect issue
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index ecf1bb212..918299fef 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -1749,15 +1749,6 @@ handle_test_blacklist_cont (void *cls, | |||
1749 | (GNUNET_OK == result) ? "allowed" : "FORBIDDEN"); | 1749 | (GNUNET_OK == result) ? "allowed" : "FORBIDDEN"); |
1750 | if (NULL == (n = lookup_neighbour (peer))) | 1750 | if (NULL == (n = lookup_neighbour (peer))) |
1751 | goto cleanup; /* nobody left to care about new address */ | 1751 | goto cleanup; /* nobody left to care about new address */ |
1752 | if (GNUNET_OK == result) | ||
1753 | { | ||
1754 | /* valid new address, let ATS know (regardless of where we are | ||
1755 | in the state machine) */ | ||
1756 | GNUNET_ATS_address_add (GST_ats, | ||
1757 | bcc->na.address, | ||
1758 | bcc->na.session, | ||
1759 | bcc->ats, bcc->ats_count); | ||
1760 | } | ||
1761 | switch (n->state) | 1752 | switch (n->state) |
1762 | { | 1753 | { |
1763 | case S_NOT_CONNECTED: | 1754 | case S_NOT_CONNECTED: |
@@ -1801,31 +1792,25 @@ handle_test_blacklist_cont (void *cls, | |||
1801 | } | 1792 | } |
1802 | break; | 1793 | break; |
1803 | case S_CONNECT_SENT: | 1794 | case S_CONNECT_SENT: |
1804 | /* waiting on CONNECT_ACK, switch session and send ACK if one is pending */ | 1795 | /* waiting on CONNECT_ACK, send ACK if one is pending */ |
1805 | if ( (GNUNET_OK == result) && | 1796 | if ( (GNUNET_OK == result) && |
1806 | (1 == n->send_connect_ack) ) | 1797 | (1 == n->send_connect_ack) ) |
1807 | { | 1798 | { |
1808 | n->send_connect_ack = 2; | 1799 | n->send_connect_ack = 2; |
1809 | /* FIXME: we might be switching to a different address here without | ||
1810 | asking (or telling!) ATS; while this is done for a good reason -- | ||
1811 | our CONNECT was not answered, but we got another session with | ||
1812 | a CONNECT from the other peer, so maybe this is an inbound session | ||
1813 | that actually works -- this is unclean as ATS needs to be told | ||
1814 | about this (or even asked first!?) Anyway, I'm adding this as | ||
1815 | something expermental for now to see if it fixes issues LRN reported | ||
1816 | on IRC on 24/6/2012. */ | ||
1817 | set_address (&n->primary_address, | ||
1818 | bcc->na.address, | ||
1819 | bcc->na.session, | ||
1820 | n->primary_address.bandwidth_in, | ||
1821 | n->primary_address.bandwidth_out, | ||
1822 | GNUNET_YES); | ||
1823 | send_session_connect_ack_message (n->primary_address.address, | 1800 | send_session_connect_ack_message (n->primary_address.address, |
1824 | n->primary_address.session, | 1801 | n->primary_address.session, |
1825 | n->connect_ack_timestamp); | 1802 | n->connect_ack_timestamp); |
1826 | } | 1803 | } |
1827 | break; | 1804 | break; |
1828 | case S_CONNECT_RECV_BLACKLIST_INBOUND: | 1805 | case S_CONNECT_RECV_BLACKLIST_INBOUND: |
1806 | if (GNUNET_OK == result) | ||
1807 | { | ||
1808 | /* valid new address, let ATS know! */ | ||
1809 | GNUNET_ATS_address_add (GST_ats, | ||
1810 | bcc->na.address, | ||
1811 | bcc->na.session, | ||
1812 | bcc->ats, bcc->ats_count); | ||
1813 | } | ||
1829 | n->state = S_CONNECT_RECV_ATS; | 1814 | n->state = S_CONNECT_RECV_ATS; |
1830 | n->timeout = GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT); | 1815 | n->timeout = GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT); |
1831 | GNUNET_ATS_reset_backoff (GST_ats, peer); | 1816 | GNUNET_ATS_reset_backoff (GST_ats, peer); |
@@ -2106,8 +2091,9 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, | |||
2106 | /* get rid of remains without terminating sessions, ready to re-try */ | 2091 | /* get rid of remains without terminating sessions, ready to re-try */ |
2107 | free_neighbour (n, GNUNET_YES); | 2092 | free_neighbour (n, GNUNET_YES); |
2108 | n = setup_neighbour (peer); | 2093 | n = setup_neighbour (peer); |
2109 | n->state = S_CONNECT_RECV_BLACKLIST_INBOUND; | 2094 | n->state = S_CONNECT_RECV_ATS; |
2110 | check_blacklist (peer, ts, address, session, ats, ats_count); | 2095 | GNUNET_ATS_reset_backoff (GST_ats, peer); |
2096 | GNUNET_ATS_suggest_address (GST_ats, peer); | ||
2111 | break; | 2097 | break; |
2112 | case S_DISCONNECT_FINISHED: | 2098 | case S_DISCONNECT_FINISHED: |
2113 | /* should not be possible */ | 2099 | /* should not be possible */ |