diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh_connection.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 8d2ef4044..35502f8c7 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -710,8 +710,8 @@ send_connection_ack (struct MeshConnection *connection, int fwd) | |||
710 | sizeof (struct GNUNET_MESH_ConnectionACK), | 710 | sizeof (struct GNUNET_MESH_ConnectionACK), |
711 | connection, fwd, &message_sent, NULL); | 711 | connection, fwd, &message_sent, NULL); |
712 | connection->pending_messages++; | 712 | connection->pending_messages++; |
713 | if (MESH_TUNNEL3_NEW == GMT_get_state (t)) | 713 | if (MESH_TUNNEL3_NEW == GMT_get_cstate (t)) |
714 | GMT_change_state (t, MESH_TUNNEL3_WAITING); | 714 | GMT_change_cstate (t, MESH_TUNNEL3_WAITING); |
715 | if (MESH_CONNECTION_READY != connection->state) | 715 | if (MESH_CONNECTION_READY != connection->state) |
716 | connection_change_state (connection, MESH_CONNECTION_SENT); | 716 | connection_change_state (connection, MESH_CONNECTION_SENT); |
717 | } | 717 | } |
@@ -803,7 +803,7 @@ connection_recreate (struct MeshConnection *c, int fwd) | |||
803 | static void | 803 | static void |
804 | connection_maintain (struct MeshConnection *c, int fwd) | 804 | connection_maintain (struct MeshConnection *c, int fwd) |
805 | { | 805 | { |
806 | if (MESH_TUNNEL3_SEARCHING == GMT_get_state (c->t)) | 806 | if (MESH_TUNNEL3_SEARCHING == GMT_get_cstate (c->t)) |
807 | { | 807 | { |
808 | /* TODO DHT GET with RO_BART */ | 808 | /* TODO DHT GET with RO_BART */ |
809 | return; | 809 | return; |
@@ -1284,8 +1284,8 @@ GMC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1284 | GMP_add_path_to_origin (orig_peer, path_duplicate (path), GNUNET_YES); | 1284 | GMP_add_path_to_origin (orig_peer, path_duplicate (path), GNUNET_YES); |
1285 | 1285 | ||
1286 | add_to_peer (c, orig_peer); | 1286 | add_to_peer (c, orig_peer); |
1287 | if (MESH_TUNNEL3_NEW == GMT_get_state (c->t)) | 1287 | if (MESH_TUNNEL3_NEW == GMT_get_cstate (c->t)) |
1288 | GMT_change_state (c->t, MESH_TUNNEL3_WAITING); | 1288 | GMT_change_cstate (c->t, MESH_TUNNEL3_WAITING); |
1289 | 1289 | ||
1290 | send_connection_ack (c, GNUNET_NO); | 1290 | send_connection_ack (c, GNUNET_NO); |
1291 | if (MESH_CONNECTION_SENT == c->state) | 1291 | if (MESH_CONNECTION_SENT == c->state) |
@@ -1395,8 +1395,8 @@ GMC_handle_confirm (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1395 | 1395 | ||
1396 | /* Change connection and tunnel state */ | 1396 | /* Change connection and tunnel state */ |
1397 | connection_change_state (c, MESH_CONNECTION_READY); | 1397 | connection_change_state (c, MESH_CONNECTION_READY); |
1398 | if (MESH_TUNNEL3_WAITING == GMT_get_state (c->t)) | 1398 | if (MESH_TUNNEL3_WAITING == GMT_get_cstate (c->t)) |
1399 | GMT_change_state (c->t, MESH_TUNNEL3_READY); | 1399 | GMT_change_cstate (c->t, MESH_TUNNEL3_READY); |
1400 | 1400 | ||
1401 | /* Send ACK (~TCP ACK)*/ | 1401 | /* Send ACK (~TCP ACK)*/ |
1402 | send_connection_ack (c, GNUNET_YES); | 1402 | send_connection_ack (c, GNUNET_YES); |
@@ -1418,8 +1418,8 @@ GMC_handle_confirm (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1418 | connection_reset_timeout (c, GNUNET_NO); | 1418 | connection_reset_timeout (c, GNUNET_NO); |
1419 | 1419 | ||
1420 | /* Change tunnel state */ | 1420 | /* Change tunnel state */ |
1421 | if (MESH_TUNNEL3_WAITING == GMT_get_state (c->t)) | 1421 | if (MESH_TUNNEL3_WAITING == GMT_get_cstate (c->t)) |
1422 | GMT_change_state (c->t, MESH_TUNNEL3_READY); | 1422 | GMT_change_cstate (c->t, MESH_TUNNEL3_READY); |
1423 | 1423 | ||
1424 | return GNUNET_OK; | 1424 | return GNUNET_OK; |
1425 | } | 1425 | } |
@@ -1734,8 +1734,8 @@ handle_mesh_kx (const struct GNUNET_PeerIdentity *peer, | |||
1734 | connection_reset_timeout (c, fwd); | 1734 | connection_reset_timeout (c, fwd); |
1735 | if (NULL != c->t) | 1735 | if (NULL != c->t) |
1736 | { | 1736 | { |
1737 | if (MESH_TUNNEL3_WAITING == GMT_get_state (c->t)) | 1737 | if (MESH_TUNNEL3_WAITING == GMT_get_cstate (c->t)) |
1738 | GMT_change_state (c->t, MESH_TUNNEL3_READY); | 1738 | GMT_change_cstate (c->t, MESH_TUNNEL3_READY); |
1739 | } | 1739 | } |
1740 | 1740 | ||
1741 | /* Is this message for us? */ | 1741 | /* Is this message for us? */ |
@@ -2652,7 +2652,7 @@ GMC_cancel (struct MeshConnectionQueue *q) | |||
2652 | void | 2652 | void |
2653 | GMC_send_create (struct MeshConnection *connection) | 2653 | GMC_send_create (struct MeshConnection *connection) |
2654 | { | 2654 | { |
2655 | enum MeshTunnel3State state; | 2655 | enum MeshTunnel3CState state; |
2656 | size_t size; | 2656 | size_t size; |
2657 | 2657 | ||
2658 | size = sizeof (struct GNUNET_MESH_ConnectionCreate); | 2658 | size = sizeof (struct GNUNET_MESH_ConnectionCreate); |
@@ -2664,9 +2664,9 @@ GMC_send_create (struct MeshConnection *connection) | |||
2664 | LOG (GNUNET_ERROR_TYPE_DEBUG, " C_P+ %p %u (create)\n", | 2664 | LOG (GNUNET_ERROR_TYPE_DEBUG, " C_P+ %p %u (create)\n", |
2665 | connection, connection->pending_messages); | 2665 | connection, connection->pending_messages); |
2666 | connection->pending_messages++; | 2666 | connection->pending_messages++; |
2667 | state = GMT_get_state (connection->t); | 2667 | state = GMT_get_cstate (connection->t); |
2668 | if (MESH_TUNNEL3_SEARCHING == state || MESH_TUNNEL3_NEW == state) | 2668 | if (MESH_TUNNEL3_SEARCHING == state || MESH_TUNNEL3_NEW == state) |
2669 | GMT_change_state (connection->t, MESH_TUNNEL3_WAITING); | 2669 | GMT_change_cstate (connection->t, MESH_TUNNEL3_WAITING); |
2670 | if (MESH_CONNECTION_NEW == connection->state) | 2670 | if (MESH_CONNECTION_NEW == connection->state) |
2671 | connection_change_state (connection, MESH_CONNECTION_SENT); | 2671 | connection_change_state (connection, MESH_CONNECTION_SENT); |
2672 | } | 2672 | } |
@@ -2765,6 +2765,9 @@ GMC_stop_poll (struct MeshConnection *c, int fwd) | |||
2765 | const char * | 2765 | const char * |
2766 | GMC_2s (struct MeshConnection *c) | 2766 | GMC_2s (struct MeshConnection *c) |
2767 | { | 2767 | { |
2768 | if (NULL == c) | ||
2769 | return "NULL"; | ||
2770 | |||
2768 | if (NULL != c->t) | 2771 | if (NULL != c->t) |
2769 | { | 2772 | { |
2770 | static char buf[128]; | 2773 | static char buf[128]; |