-only notify AFTER sending is really close to finished, not before
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_tunnel.c
index 26fe909e7e04d138b7fc470d5b96dca95c9a6b4f..e30c8cd978dba1d9a2b55fe0fbcfc4ccdff2e7d3 100644 (file)
@@ -578,7 +578,8 @@ send_queued_data (struct MeshTunnel3 *t)
     room--;
     GNUNET_CONTAINER_DLL_remove (t->tq_head, t->tq_tail, tq);
     GMCH_send_prebuilt_message ((struct GNUNET_MessageHeader *) &tq[1],
-                                tq->ch, GMCH_is_origin (tq->ch, GNUNET_YES));
+                                tq->ch, GMCH_is_origin (tq->ch, GNUNET_YES),
+                                GNUNET_NO);
 
     GNUNET_free (tq);
   }
@@ -2000,6 +2001,23 @@ message_sent (void *cls,
   GNUNET_free (qt);
 }
 
+
+/**
+ * Cancel a previously sent message while it's in the queue.
+ *
+ * ONLY can be called before the continuation given to the send function
+ * is called. Once the continuation is called, the message is no longer in the
+ * queue.
+ *
+ * @param q Handle to the queue.
+ */
+void
+GMT_cancel (struct MeshTunnel3Queue *q)
+{
+  GMC_cancel (q->q);
+  /* message_sent() will be called and free q */
+}
+
 /**
  * Sends an already built message on a tunnel, encrypting it and
  * choosing the best connection.