- doc
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_peer.c
index 241e6481ea02ea450d7ef709bc2f7a111bca53b1..5fe19e646c7ac378b28de2d9097c1b9d3fd3ba47 100644 (file)
@@ -766,7 +766,6 @@ queue_is_sendable (struct MeshPeerQueue *q)
     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:
@@ -776,10 +775,7 @@ queue_is_sendable (struct MeshPeerQueue *q)
       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);
 }
 
 
@@ -788,7 +784,7 @@ queue_is_sendable (struct MeshPeerQueue *q)
  *
  * @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)
@@ -797,6 +793,7 @@ 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;
   }
@@ -1924,6 +1921,10 @@ void
 GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel3 *t)
 {
   peer->tunnel = t;
+  if (NULL == t && NULL != peer->search_h)
+  {
+    GMP_stop_search (peer);
+  }
 }