/**
* Tail of list of messages scheduled for transmission.
*/
- struct TunnelMessageQueueEntry *tmq_tail;
+ struct TunnelMessageQueueEntry *tmq_tail;
/**
* Client that needs to be notified about the tunnel being
*/
struct GNUNET_SERVER_Client *client;
+ /**
+ * Destination entry that has a pointer to this tunnel state;
+ * NULL if this tunnel state is in the tunnel map.
+ */
+ struct DestinationEntry *destination_container;
+
/**
* ID of the client request that caused us to setup this entry.
*/
struct DestinationEntry destination;
/**
- * Destination entry that has a pointer to this tunnel state;
- * NULL if this tunnel state is in the tunnel map.
+ * Addess family used for this tunnel on the local TUN interface.
*/
- struct DestinationEntry *destination_container;
+ int af;
/**
- * Addess family used for this tunnel on the local TUN interface.
+ * Length of the doubly linked 'tmq_head/tmq_tail' list.
*/
- int af;
+ unsigned int tmq_length;
/**
* IPPROTO_TCP or IPPROTO_UDP once bound.
GNUNET_CONTAINER_DLL_remove (ts->tmq_head,
ts->tmq_tail,
tnq);
+ ts->tmq_length--;
memcpy (buf, tnq->msg, tnq->len);
ret = tnq->len;
GNUNET_free (tnq);
GNUNET_CONTAINER_DLL_insert_tail (ts->tmq_head,
ts->tmq_tail,
tnq);
+ ts->tmq_length++;
if (NULL == ts->th)
ts->th = GNUNET_MESH_notify_transmit_ready (ts->tunnel,
GNUNET_NO /* cork */,
GNUNET_CONTAINER_DLL_remove (ts->tmq_head,
ts->tmq_tail,
tnq);
+ ts->tmq_length--;
GNUNET_free (tnq);
}
+ GNUNET_assert (0 == ts->tmq_length);
if (NULL != ts->client)
{
GNUNET_SERVER_client_drop (ts->client);