diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-25 16:54:19 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-25 16:54:19 +0000 |
commit | 9c4741e490a1b193feb1a6b925d4cdd84ba7b0c2 (patch) | |
tree | e07b5c60d2ad08d51c110707f7a02416af26e247 /src | |
parent | b9c87498868c88745df077108be224bf3771a6e3 (diff) | |
download | gnunet-9c4741e490a1b193feb1a6b925d4cdd84ba7b0c2.tar.gz gnunet-9c4741e490a1b193feb1a6b925d4cdd84ba7b0c2.zip |
implemented:
send connect
send connect_ack
receive connect_ack -> mark peer as connected
next step:
send ack or wait for payload and include ack
mark other half as connected
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours_fsm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours_fsm.c b/src/transport/gnunet-service-transport_neighbours_fsm.c index f9794967a..ea92e776f 100644 --- a/src/transport/gnunet-service-transport_neighbours_fsm.c +++ b/src/transport/gnunet-service-transport_neighbours_fsm.c | |||
@@ -954,7 +954,8 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target) | |||
954 | GNUNET_assert (neighbours != NULL); | 954 | GNUNET_assert (neighbours != NULL); |
955 | 955 | ||
956 | n = lookup_neighbour (target); | 956 | n = lookup_neighbour (target); |
957 | if ((NULL == n) || (n->is_connected != GNUNET_YES)) | 957 | |
958 | if ((NULL == n) || (n->state != S_CONNECTED)) | ||
958 | return GNUNET_NO; /* not connected */ | 959 | return GNUNET_NO; /* not connected */ |
959 | return GNUNET_YES; | 960 | return GNUNET_YES; |
960 | } | 961 | } |
@@ -1440,7 +1441,7 @@ static void neighbour_connected (struct NeighbourMapEntry *n, | |||
1440 | return; | 1441 | return; |
1441 | // First tell clients about connected neighbours... | 1442 | // First tell clients about connected neighbours... |
1442 | //change_state (n, S_CONNECTED); | 1443 | //change_state (n, S_CONNECTED); |
1443 | 1444 | change_state (n, S_CONNECTED); | |
1444 | neighbours_connected++; | 1445 | neighbours_connected++; |
1445 | GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1, | 1446 | GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1, |
1446 | GNUNET_NO); | 1447 | GNUNET_NO); |
@@ -1494,8 +1495,6 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
1494 | GNUNET_break (0); | 1495 | GNUNET_break (0); |
1495 | return; | 1496 | return; |
1496 | } | 1497 | } |
1497 | |||
1498 | change_state (n, S_CONNECTED); | ||
1499 | neighbour_connected (n, ats, ats_count); | 1498 | neighbour_connected (n, ats, ats_count); |
1500 | } | 1499 | } |
1501 | 1500 | ||
@@ -1546,7 +1545,8 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, | |||
1546 | return; | 1545 | return; |
1547 | 1546 | ||
1548 | change_state (n, S_CONNECT_RECV); | 1547 | change_state (n, S_CONNECT_RECV); |
1549 | /* send CONNECT_ACK */ | 1548 | |
1549 | /* send CONNECT_ACK (SYN_ACK)*/ | ||
1550 | connect_msg.header.size = htons (sizeof (struct SessionConnectMessage)); | 1550 | connect_msg.header.size = htons (sizeof (struct SessionConnectMessage)); |
1551 | connect_msg.header.type = | 1551 | connect_msg.header.type = |
1552 | htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT_ACK); | 1552 | htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT_ACK); |