peer = get_next_hop (c);
if (GNUNET_OK != GMP_remove_connection (peer, c))
{
- GNUNET_break (MESH_CONNECTION_NEW == c->state
+ GNUNET_assert (MESH_CONNECTION_NEW == c->state
|| MESH_CONNECTION_DESTROYED == c->state);
LOG (GNUNET_ERROR_TYPE_DEBUG, " cstate: %u\n", c->state);
if (NULL != c->t) GMT_debug (c->t);
peer = get_prev_hop (c);
if (GNUNET_OK != GMP_remove_connection (peer, c))
{
- GNUNET_break (MESH_CONNECTION_NEW == c->state
+ GNUNET_assert (MESH_CONNECTION_NEW == c->state
|| MESH_CONNECTION_DESTROYED == c->state);
LOG (GNUNET_ERROR_TYPE_DEBUG, " cstate: %u\n", c->state);
if (NULL != c->t) GMT_debug (c->t);
* @param c Connection.
*/
const char *
-GMC_2s (struct MeshConnection *c)
+GMC_2s (const struct MeshConnection *c)
{
if (NULL == c)
return "NULL";
* @param c Connection.
*/
const char *
-GMC_2s (struct MeshConnection *c);
+GMC_2s (const struct MeshConnection *c);
#if 0 /* keep Emacsens' auto-indent happy */
{
prev = q->prev;
if (q->c == c)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "GMP_cancel_queue %s\n",
- GM_m2s (q->type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "GMP_cancel_queue %s\n", GM_m2s (q->type));
GMP_queue_destroy (q, GNUNET_YES);
/* Get next from prev, q->next might be already freed:
GMP_remove_connection (struct MeshPeer *peer,
const struct MeshConnection *c)
{
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "removing connection %s from peer %s\n",
+ GMC_2s (c), GMP_2s (peer));
if (NULL == peer || NULL == peer->connections)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
static int
is_ready (struct MeshTunnel3 *t)
{
- return (MESH_TUNNEL3_READY == t->cstate
- && MESH_TUNNEL3_KEY_OK == t->estate)
- || GMT_is_loopback (t);
+ int ready;
+
+ GMT_debug (t);
+ ready = (MESH_TUNNEL3_READY == t->cstate && MESH_TUNNEL3_KEY_OK == t->estate);
+ ready = ready || GMT_is_loopback (t);
+ return ready;
}
return;
}
+ if (GNUNET_NO != t->destroy)
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " being destroyed, why bother\n");
+ return;
+ }
+
/* Must have a connection. */
if (NULL == t->connection_head)
{