gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r23938 - gnunet/src/mesh
Date: Fri, 21 Sep 2012 19:35:25 +0200

Author: bartpolot
Date: 2012-09-21 19:35:25 +0200 (Fri, 21 Sep 2012)
New Revision: 23938

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- dont destroy a tunnel right when a client leaves, send pending messages first

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-09-21 16:49:19 UTC (rev 
23937)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-09-21 17:35:25 UTC (rev 
23938)
@@ -4335,15 +4335,12 @@
  * @param cls closure (client that is disconnecting)
  * @param key the hash of the local tunnel id (used to access the hashmap)
  * @param value the value stored at the key (tunnel to destroy)
- *
- * @return GNUNET_OK on success
  */
-static int
+static void
 tunnel_destroy_iterator (void *cls, const struct GNUNET_HashCode * key, void 
*value)
 {
   struct MeshTunnel *t = value;
   struct MeshClient *c = cls;
-  int r;
 
   send_client_tunnel_disconnect(t, c);
   if (c != t->owner)
@@ -4355,8 +4352,8 @@
     return GNUNET_OK;
   }
   tunnel_send_destroy(t);
-  r = tunnel_destroy (t);
-  return r;
+  t->owner = NULL;
+  t->destroy = GNUNET_YES;
 }
 
 
@@ -4831,7 +4828,8 @@
                       cinfo->send_buffer[cinfo->send_buffer_start],
                       queue);
         }
-        if (cinfo->send_buffer_n > 0) {
+        if (cinfo->send_buffer_n > 0)
+        {
           cinfo->send_buffer[cinfo->send_buffer_start] = NULL;
           cinfo->send_buffer_n--;
           cinfo->send_buffer_start++;
@@ -4967,13 +4965,15 @@
   if (NULL != cinfo->send_buffer[i])
   {
     GNUNET_break (cinfo->send_buffer_n == t->fwd_queue_max); // aka i == start
-    queue_destroy(cinfo->send_buffer[cinfo->send_buffer_start], GNUNET_YES);
+    queue_destroy (cinfo->send_buffer[cinfo->send_buffer_start], GNUNET_YES);
     cinfo->send_buffer_start++;
     cinfo->send_buffer_start %= t->fwd_queue_max;
-    cinfo->send_buffer_n--;
   }
+  else
+  {
+    cinfo->send_buffer_n++;
+  }
   cinfo->send_buffer[i] = queue;
-  cinfo->send_buffer_n++;
   if (cinfo->send_buffer_n > t->fwd_queue_max)
   {
     GNUNET_break (0);




reply via email to

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