gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r32720 - gnunet/src/mesh
Date: Fri, 21 Mar 2014 19:44:18 +0100

Author: bartpolot
Date: 2014-03-21 19:44:18 +0100 (Fri, 21 Mar 2014)
New Revision: 32720

Modified:
   gnunet/src/mesh/gnunet-service-mesh_connection.c
Log:
- requeue messages on connection broken

Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c    2014-03-21 18:44:17 UTC 
(rev 32719)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c    2014-03-21 18:44:18 UTC 
(rev 32720)
@@ -1741,7 +1741,7 @@
 
 
 /**
- * Core handler for notifications of broken paths
+ * Core handler for notifications of broken connections.
  *
  * @param cls Closure (unused).
  * @param id Peer identity of sending neighbor.
@@ -1775,11 +1775,20 @@
   fwd = is_fwd (c, id);
   if (GMC_is_terminal (c, fwd))
   {
+    struct GNUNET_MessageHeader *msg;
+    struct MeshPeer *peer;
+
+    peer = get_hop (c, !fwd);
     path_invalidate (c->path);
-    if (0 < c->pending_messages)
-      c->destroy = GNUNET_YES;
-    else
-      GMC_destroy (c);
+    c->state = MESH_CONNECTION_DESTROYED;
+    while (NULL != (msg = GMP_connection_pop (peer, c)))
+    {
+      GNUNET_assert (NULL ==
+                     GMT_send_prebuilt_message (msg, c->t, NULL, GNUNET_YES,
+                                                NULL, NULL));
+    }
+
+    GMC_destroy (c);
   }
   else
   {




reply via email to

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