summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-15 08:07:14 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-15 08:07:14 +0000
commita6e462f5b2b959ca3fd953d59f4b775ea881154d (patch)
treead7f1d88b29dc49fe7ac4153e6a5bca44b325232 /src
parent12d99c03dca80ffb4f05d54f5ad9933db51d221d (diff)
asserts for 1903:
Diffstat (limited to 'src')
-rw-r--r--src/transport/gnunet-service-transport.c1
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c16
2 files changed, 10 insertions, 7 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 0b21812de..b148f289b 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -336,6 +336,7 @@ plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer,
const char *transport_name = cls;
struct GNUNET_HELLO_Address address;
+ GNUNET_assert (strlen(transport_name) > 0);
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n",
session, GNUNET_i2s (peer));
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index b01c82d55..67eb9f39b 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -471,7 +471,7 @@ reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
n->state = S_NOT_CONNECTED;
/* destroying address */
-
+ GNUNET_assert (strlen(n->address->transport_name) > 0);
GNUNET_ATS_address_destroyed (GST_ats, n->address, n->session);
/* request new address */
@@ -1142,7 +1142,10 @@ send_connect_continuation (void *cls, const struct GNUNET_PeerIdentity *target,
struct NeighbourMapEntry *n = lookup_neighbour (&cc->address->peer);
if (GNUNET_YES != success)
+ {
+ GNUNET_assert (strlen(cc->address->transport_name) > 0);
GNUNET_ATS_address_destroyed (GST_ats, cc->address, cc->session);
+ }
if ( (NULL == neighbours) ||
(NULL == n) ||
(n->state == S_DISCONNECT))
@@ -1172,9 +1175,6 @@ send_connect_continuation (void *cls, const struct GNUNET_PeerIdentity *target,
n->session);
#endif
change_state (n, S_NOT_CONNECTED);
-
- GNUNET_ATS_address_destroyed (GST_ats, cc->address, cc->session);
-
if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (n->ats_suggest);
n->ats_suggest =
@@ -1225,6 +1225,7 @@ send_switch_address_continuation (void *cls,
GNUNET_i2s (&n->id),
GST_plugins_a2s (n->address), n->session);
#endif
+ GNUNET_assert (strlen(cc->address->transport_name) > 0);
GNUNET_ATS_address_destroyed (GST_ats, cc->address, cc->session);
if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK)
@@ -1333,7 +1334,7 @@ send_connect_ack_continuation (void *cls,
n->session);
#endif
change_state (n, S_NOT_CONNECTED);
-
+ GNUNET_assert (strlen(cc->address->transport_name) > 0);
GNUNET_ATS_address_destroyed (GST_ats, cc->address, cc->session);
if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK)
@@ -1342,7 +1343,6 @@ send_connect_ack_continuation (void *cls,
GNUNET_SCHEDULER_add_delayed (ATS_RESPONSE_TIMEOUT, ats_suggest_cancel,
n);
GNUNET_ATS_suggest_address (GST_ats, &n->id);
-
GNUNET_HELLO_address_free (cc->address);
GNUNET_free (cc);
}
@@ -1394,7 +1394,9 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer,
if ( (session == NULL) && (0 == address->address_length) )
{
GNUNET_break_op (0);
- GNUNET_ATS_address_destroyed (GST_ats, address, session);
+ /* FIXME: is this actually possible? When does this happen? */
+ if (strlen(address->transport_name) > 0)
+ GNUNET_ATS_address_destroyed (GST_ats, address, session);
GNUNET_ATS_suggest_address (GST_ats, peer);
return GNUNET_NO;
}