gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31466 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r31466 - gnunet/src/mesh
Date: Tue, 17 Dec 2013 06:18:16 +0100

Author: bartpolot
Date: 2013-12-17 06:18:16 +0100 (Tue, 17 Dec 2013)
New Revision: 31466

Modified:
   gnunet/src/mesh/gnunet-service-mesh_tunnel.c
Log:
- respond to data on unknown channels with destroy (avoids retransmissions)


Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-12-17 04:56:00 UTC 
(rev 31465)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-12-17 05:18:16 UTC 
(rev 31466)
@@ -541,6 +541,7 @@
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "WARNING got data on %s without a valid key\n",
          GMT_2s (t));
+    GMT_debug (t);
     return 0;
   }
 
@@ -1133,6 +1134,29 @@
 
 
 /**
+ * Notify remote peer that we don't know a channel he is talking about,
+ * probably CHANNEL_DESTROY was missed.
+ *
+ * @param t Tunnel on which to notify.
+ * @param gid ID of the channel.
+ */
+static void
+send_channel_destroy (struct MeshTunnel3 *t, unsigned int gid)
+{
+  struct GNUNET_MESH_ChannelManage msg;
+
+  msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY);
+  msg.header.size = htons (sizeof (msg));
+  msg.chid = htonl (gid);
+
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "WARNING destroying unknown channel %u on tunnel %s\n",
+       gid, GMT_2s (t));
+  send_prebuilt_message (&msg.header, t, GNUNET_YES, NULL, NULL, NULL);
+}
+
+
+/**
  * Demultiplex data per channel and call appropriate channel handler.
  *
  * @param t Tunnel on which the data came.
@@ -1170,6 +1194,7 @@
                               1, GNUNET_NO);
     LOG (GNUNET_ERROR_TYPE_DEBUG, "WARNING channel 0x%X unknown\n",
          ntohl (msg->chid));
+    send_channel_destroy (t, ntohl (msg->chid));
     return;
   }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]