for (op = incoming_head; NULL != op; op = op->next)
if (op->state->suggest_id == id)
+ {
+ // FIXME: remove this assertion once the corresponding bug is gone!
+ GNUNET_assert (GNUNET_YES == op->is_incoming);
return op;
+ }
return NULL;
}
static void
incoming_destroy (struct Operation *incoming)
{
+ GNUNET_assert (GNUNET_YES == incoming->is_incoming);
GNUNET_CONTAINER_DLL_remove (incoming_head, incoming_tail, incoming);
if (GNUNET_SCHEDULER_NO_TASK != incoming->state->timeout_task)
{
GNUNET_SCHEDULER_cancel (incoming->state->timeout_task);
incoming->state->timeout_task = GNUNET_SCHEDULER_NO_TASK;
}
+ GNUNET_assert (NULL != incoming->state);
GNUNET_free (incoming->state);
+ // make sure that the tunnel end handler will not
+ // destroy us again
+ incoming->vt = NULL;
+ incoming->state = NULL;
}
static void
incoming_retire (struct Operation *incoming)
{
+ GNUNET_assert (GNUNET_YES == incoming->is_incoming);
incoming->is_incoming = GNUNET_NO;
+ GNUNET_assert (NULL != incoming->state);
GNUNET_free (incoming->state);
incoming->state = NULL;
GNUNET_CONTAINER_DLL_remove (incoming_head, incoming_tail, incoming);
{
struct GNUNET_MQ_Envelope *mqm;
struct GNUNET_SET_RequestMessage *cmsg;
-
+
+ GNUNET_assert (GNUNET_YES == incoming->is_incoming);
+ GNUNET_assert (NULL != incoming->state);
GNUNET_assert (NULL != incoming->spec);
GNUNET_assert (0 == incoming->state->suggest_id);
incoming->state->suggest_id = suggest_id++;
struct Listener *listener;
struct OperationSpecification *spec;
+ GNUNET_assert (GNUNET_YES == op->is_incoming);
+
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "got op request\n");
if (GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST != ntohs (mh->type))
handle_incoming_disconnect (struct Operation *op)
{
GNUNET_assert (GNUNET_YES == op->is_incoming);
- if (NULL == op->channel)
- return;
incoming_destroy (op);
+ op->vt = NULL;
}
/**
- * Functions with this signature are called whenever any message is
- * received via the mesh channel.
+ * Functions with this signature are called whenever a message is
+ * received via a mesh channel.
*
* The msg_handler is a virtual table set in initially either when a peer
* creates a new channel with us (channel_new_cb), or once we create a new channel
{dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SE, 0},
{dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_ELEMENT_INFO, 0},
{dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF, 0},
+ {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF_PART, 0},
{NULL, 0, 0}
};
static const uint32_t mesh_ports[] = {GNUNET_APPLICATION_TYPE_SET, 0};