[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31000 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31000 - gnunet/src/mesh |
Date: |
Sun, 1 Dec 2013 01:44:45 +0100 |
Author: bartpolot
Date: 2013-12-01 01:44:45 +0100 (Sun, 01 Dec 2013)
New Revision: 31000
Modified:
gnunet/src/mesh/gnunet-service-mesh_channel.c
gnunet/src/mesh/gnunet-service-mesh_tunnel.c
gnunet/src/mesh/gnunet-service-mesh_tunnel.h
Log:
- cleanup tunnel api
- doxygen
Modified: gnunet/src/mesh/gnunet-service-mesh_channel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_channel.c 2013-12-01 00:37:36 UTC
(rev 30999)
+++ gnunet/src/mesh/gnunet-service-mesh_channel.c 2013-12-01 00:44:45 UTC
(rev 31000)
@@ -804,6 +804,24 @@
/**
+ * Sent a message and don't keep any info about it: we won't need to cancel it
+ * or resend it.
+ *
+ * @param msg Header of the message to fire away.
+ * @param ch Channel on which the message should go.
+ * @param force Is this a forced (undroppable) message?
+ */
+static void
+fire_and_forget (const struct GNUNET_MessageHeader *msg,
+ struct MeshChannel *ch,
+ int force)
+{
+ GNUNET_break (NULL == GMT_send_prebuilt_message (msg, ch->t, ch, force,
+ NULL, NULL));
+}
+
+
+/**
* Notify that a channel create didn't succeed.
*
* @param ch The channel to reject.
@@ -2090,17 +2108,6 @@
}
-void
-fire_and_forget (struct GNUNET_MessageHeader *msg,
- struct MeshChannel *ch,
- int force)
-{
- GNUNET_break (NULL == GMT_send_prebuilt_message (msg, ch->t, ch,
- GNUNET_YES, force,
- NULL, NULL));
-}
-
-
/**
* Sends an already built message on a channel.
*
@@ -2173,7 +2180,7 @@
LOG (GNUNET_ERROR_TYPE_DEBUG, " new q: %p\n", q);
q->copy->q = q;
q->q = GMT_send_prebuilt_message (message, ch->t, ch,
- fwd, NULL != existing_copy,
+ NULL != existing_copy,
&ch_message_sent, q);
/* q itself is stored in copy */
}
@@ -2209,8 +2216,7 @@
GNUNET_free (q->rel->uniq);
}
}
- q->q = GMT_send_prebuilt_message (message, ch->t, ch,
- fwd, GNUNET_YES,
+ q->q = GMT_send_prebuilt_message (message, ch->t, ch, GNUNET_YES,
&ch_message_sent, q);
q->rel->uniq = q;
break;
Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c 2013-12-01 00:37:36 UTC
(rev 30999)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c 2013-12-01 00:44:45 UTC
(rev 31000)
@@ -2150,7 +2150,6 @@
* @param message Message to send. Function modifies it.
* @param t Tunnel on which this message is transmitted.
* @param ch Channel on which this message is transmitted.
- * @param fwd Is this a fwd message on @c ch?
* @param force Force the tunnel to take the message (buffer overfill).
* @param cont Continuation to call once message is really sent.
* @param cont_cls Closure for @c cont.
@@ -2159,8 +2158,8 @@
*/
struct MeshTunnel3Queue *
GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
- struct MeshTunnel3 *t,
- struct MeshChannel *ch, int fwd, int force,
+ struct MeshTunnel3 *t, struct MeshChannel *ch,
+ int force,
GMT_sent cont, void *cont_cls)
{
struct MeshTunnel3Queue *q;
@@ -2171,6 +2170,7 @@
char cbuf[sizeof (struct GNUNET_MESH_Encrypted) + size];
uint32_t iv;
uint16_t type;
+ int fwd;
LOG (GNUNET_ERROR_TYPE_DEBUG, "GMT Send on Tunnel %s\n", GMT_2s (t));
@@ -2181,13 +2181,7 @@
return NULL;
}
- if (GMT_is_loopback (t))
- {
- LOG (GNUNET_ERROR_TYPE_DEBUG, " loopback!\n");
- handle_decrypted (t, message, fwd);
- GNUNET_break (0); /* FIXME replace with assert */
- return NULL; /* Already delivered, cannot cancel */
- }
+ GNUNET_assert (GNUNET_NO == GMT_is_loopback (t));
iv = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX);
msg = (struct GNUNET_MESH_Encrypted *) cbuf;
Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.h 2013-12-01 00:37:36 UTC
(rev 30999)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.h 2013-12-01 00:44:45 UTC
(rev 31000)
@@ -393,7 +393,6 @@
* @param message Message to send. Function modifies it.
* @param t Tunnel on which this message is transmitted.
* @param ch Channel on which this message is transmitted.
- * @param fwd Is this a fwd message on @c ch?
* @param force Force the tunnel to take the message (buffer overfill).
* @param cont Continuation to call once message is really sent.
* @param cont_cls Closure for @c cont.
@@ -403,7 +402,7 @@
struct MeshTunnel3Queue *
GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
struct MeshTunnel3 *t,
- struct MeshChannel *ch, int fwd, int force,
+ struct MeshChannel *ch, int force,
GMT_sent cont, void *cont_cls);
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31000 - gnunet/src/mesh,
gnunet <=