case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK:
case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY:
case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN:
- case GNUNET_MESSAGE_TYPE_MESH_KEEPALIVE:
return GNUNET_YES;
case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
GNUNET_break (0);
}
- if (GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN != q->type)
- return GMC_is_sendable (q->c, q->fwd);
-
- return GNUNET_NO;
+ return GMC_is_sendable (q->c, q->fwd);
}
*
* @param peer The destination peer.
*
- * @return Best current known path towards the peer, if any.
+ * @return First transmittable message, if any. Otherwise, NULL.
*/
static struct MeshPeerQueue *
peer_get_first_message (const struct MeshPeer *peer)
for (q = peer->queue_head; NULL != q; q = q->next)
{
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Checking %p towards %s\n", q, GMC_2s (q->c));
if (queue_is_sendable (q))
return q;
}
queue = peer_get_first_message (peer);
if (NULL == queue)
{
- GNUNET_break (0); /* Core tmt_rdy should've been canceled */
+ GNUNET_assert (0); /* Core tmt_rdy should've been canceled */
return 0;
}
c = queue->c;
sizeof (GNUNET_PEER_Id) * path->length))
{
GNUNET_CONTAINER_DLL_remove (peer->path_head, peer->path_tail, iter);
- path_destroy (iter);
- if (path == iter)
- return;
+ if (iter != path)
+ path_destroy (iter);
}
}
path_destroy (path);
GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel3 *t)
{
peer->tunnel = t;
+ if (NULL == t && NULL != peer->search_h)
+ {
+ GMP_stop_search (peer);
+ }
}
char *s;
s = path_2s (iter);
- LOG (GNUNET_ERROR_TYPE_DEBUG, " - destroying %s\n", s);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " - invalidating %s\n", s);
GNUNET_free (s);
- GNUNET_CONTAINER_DLL_remove (peer->path_head, peer->path_tail, iter);
- path_destroy (iter);
+ path_invalidate (iter);
}
}
}