}
+/**
+ * Get the first message for a connection and unqueue it.
+ *
+ * @param peer Neighboring peer.
+ * @param c Connection.
+ *
+ * @return First message for this connection.
+ */
+struct GNUNET_MessageHeader *
+GMP_connection_pop (struct MeshPeer *peer, struct MeshConnection *c)
+{
+ struct MeshPeerQueue *q;
+ struct GNUNET_MessageHeader *msg;
+
+ for (q = peer->queue_head; NULL != q; q = q->next)
+ {
+ if (q->c != c)
+ continue;
+ switch (q->type)
+ {
+ case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE:
+ 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_ACK:
+ case GNUNET_MESSAGE_TYPE_MESH_POLL:
+ GMP_queue_destroy (q, GNUNET_YES);
+ continue;
+
+ case GNUNET_MESSAGE_TYPE_MESH_KX:
+ case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
+ msg = (struct GNUNET_MessageHeader *) q->cls;
+ GMP_queue_destroy (q, GNUNET_NO);
+ return msg;
+
+ default:
+ GNUNET_break (0);
+ }
+ }
+
+ return NULL;
+}
+
+
void
GMP_queue_unlock (struct MeshPeer *peer, struct MeshConnection *c)
{
transport_handle = GNUNET_TRANSPORT_connect (c, &my_full_id, NULL, /* cls */
/* Notify callbacks */
NULL, NULL, NULL);
-
}
+ else
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING, "**************************************\n");
+ LOG (GNUNET_ERROR_TYPE_WARNING, "* DISABLE TRYING CONNECT in config *\n");
+ LOG (GNUNET_ERROR_TYPE_WARNING, "* Use this only for test purposes. *\n");
+ LOG (GNUNET_ERROR_TYPE_WARNING, "**************************************\n");
+ }
+
if (NULL == core_handle)