aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.c')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 97d184e8e..af1f03ee1 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -783,7 +783,7 @@ get_prev_hop (const struct CadetConnection *c)
783 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s (%u)\n", 783 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s (%u)\n",
784 GNUNET_i2s (GNUNET_PEER_resolve2 (id)), id); 784 GNUNET_i2s (GNUNET_PEER_resolve2 (id)), id);
785 785
786 return GCP_get_short (id); 786 return GCP_get_short (id, GNUNET_YES);
787} 787}
788 788
789 789
@@ -812,7 +812,7 @@ get_next_hop (const struct CadetConnection *c)
812 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s (%u)\n", 812 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s (%u)\n",
813 GNUNET_i2s (GNUNET_PEER_resolve2 (id)), id); 813 GNUNET_i2s (GNUNET_PEER_resolve2 (id)), id);
814 814
815 return GCP_get_short (id); 815 return GCP_get_short (id, GNUNET_YES);
816} 816}
817 817
818 818
@@ -1038,7 +1038,8 @@ send_broken_unknown (const struct GNUNET_CADET_Hash *connection_id,
1038 msg->peer2 = *id2; 1038 msg->peer2 = *id2;
1039 else 1039 else
1040 memset (&msg->peer2, 0, sizeof (msg->peer2)); 1040 memset (&msg->peer2, 0, sizeof (msg->peer2));
1041 neighbor = GCP_get (peer_id); 1041 neighbor = GCP_get (peer_id, GNUNET_NO); /* We MUST know neighbor. */
1042 GNUNET_assert (NULL != neighbor);
1042 GCP_queue_add (neighbor, msg, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, 1043 GCP_queue_add (neighbor, msg, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN,
1043 0, 2, sizeof (struct GNUNET_CADET_ConnectionBroken), 1044 0, 2, sizeof (struct GNUNET_CADET_ConnectionBroken),
1044 NULL, GNUNET_SYSERR, /* connection, fwd */ 1045 NULL, GNUNET_SYSERR, /* connection, fwd */
@@ -1777,7 +1778,9 @@ does_connection_exist (struct CadetConnection *conn)
1777 struct CadetTunnel *t; 1778 struct CadetTunnel *t;
1778 struct CadetConnection *c; 1779 struct CadetConnection *c;
1779 1780
1780 p = GCP_get_short (conn->path->peers[0]); 1781 p = GCP_get_short (conn->path->peers[0], GNUNET_NO);
1782 if (NULL == p)
1783 return GNUNET_NO;
1781 t = GCP_get_tunnel (p); 1784 t = GCP_get_tunnel (p);
1782 if (NULL == t) 1785 if (NULL == t)
1783 return GNUNET_NO; 1786 return GNUNET_NO;
@@ -1967,8 +1970,8 @@ GCC_handle_create (void *cls,
1967 connection_change_state (c, CADET_CONNECTION_SENT); 1970 connection_change_state (c, CADET_CONNECTION_SENT);
1968 1971
1969 /* Remember peers */ 1972 /* Remember peers */
1970 dest_peer = GCP_get (&id[size - 1]); 1973 dest_peer = GCP_get (&id[size - 1], GNUNET_YES);
1971 orig_peer = GCP_get (&id[0]); 1974 orig_peer = GCP_get (&id[0], GNUNET_YES);
1972 1975
1973 /* Is it a connection to us? */ 1976 /* Is it a connection to us? */
1974 if (c->own_pos == path->length - 1) 1977 if (c->own_pos == path->length - 1)
@@ -2056,7 +2059,7 @@ GCC_handle_confirm (void *cls,
2056 2059
2057 oldstate = c->state; 2060 oldstate = c->state;
2058 LOG (GNUNET_ERROR_TYPE_DEBUG, " via peer %s\n", GNUNET_i2s (peer)); 2061 LOG (GNUNET_ERROR_TYPE_DEBUG, " via peer %s\n", GNUNET_i2s (peer));
2059 pi = GCP_get (peer); 2062 pi = GCP_get (peer, GNUNET_YES);
2060 if (get_next_hop (c) == pi) 2063 if (get_next_hop (c) == pi)
2061 { 2064 {
2062 LOG (GNUNET_ERROR_TYPE_DEBUG, " SYNACK\n"); 2065 LOG (GNUNET_ERROR_TYPE_DEBUG, " SYNACK\n");
@@ -2194,7 +2197,7 @@ GCC_handle_broken (void* cls,
2194 GCC_debug (c, GNUNET_ERROR_TYPE_ERROR); 2197 GCC_debug (c, GNUNET_ERROR_TYPE_ERROR);
2195 return GNUNET_OK; 2198 return GNUNET_OK;
2196 } 2199 }
2197 endpoint = GCP_get_short (c->path->peers[c->path->length - 1]); 2200 endpoint = GCP_get_short (c->path->peers[c->path->length - 1], GNUNET_YES);
2198 if (2 < c->path->length) 2201 if (2 < c->path->length)
2199 path_invalidate (c->path); 2202 path_invalidate (c->path);
2200 GCP_notify_broken_link (endpoint, &msg->peer1, &msg->peer2); 2203 GCP_notify_broken_link (endpoint, &msg->peer1, &msg->peer2);