gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r28479 - gnunet/src/mesh
Date: Thu, 8 Aug 2013 19:30:02 +0200

Author: bartpolot
Date: 2013-08-08 19:30:02 +0200 (Thu, 08 Aug 2013)
New Revision: 28479

Modified:
   gnunet/src/mesh/gnunet-service-mesh-enc.c
Log:
- fixes


Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-08 16:58:44 UTC (rev 
28478)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-08 17:30:02 UTC (rev 
28479)
@@ -5711,9 +5711,9 @@
                   const struct GNUNET_MessageHeader *message)
 {
   struct GNUNET_MESH_LocalAck *msg;
-  struct MeshTunnel *t;
+  struct MeshChannel *ch;
   struct MeshClient *c;
-  MESH_ChannelNumber tid;
+  MESH_ChannelNumber chid;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got a local ACK\n");
   /* Sanity check for client registration */
@@ -5728,28 +5728,28 @@
   msg = (struct GNUNET_MESH_LocalAck *) message;
 
   /* Tunnel exists? */
-  tid = ntohl (msg->channel_id);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  on tunnel %X\n", tid);
-  t = channel_get_by_local_id (c, tid);
-  if (NULL == t)
+  chid = ntohl (msg->channel_id);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  on channel %X\n", chid);
+  ch = channel_get_by_local_id (c, chid);
+  if (NULL == ch)
   {
     GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Tunnel %X unknown.\n", tid);
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Channel %X unknown.\n", chid);
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "  for client %u.\n", c->id);
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
 
   /* Does client own tunnel? I.E: Is this an ACK for BCK traffic? */
-  if (tid < GNUNET_MESH_LOCAL_CHANNEL_ID_SERV)
+  if (chid < GNUNET_MESH_LOCAL_CHANNEL_ID_SERV)
   {
-    /* The client owns the tunnel, ACK is for data to_origin, send BCK ACK. */
-    t->prev_fc.last_ack_recv++;
+    /* The client owns the channel, ACK is for data to_origin, send BCK ACK. */
+    ch->prev_fc.last_ack_recv++;
     tunnel_send_ack (t, GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK, GNUNET_NO);
   }
   else
   {
-    /* The client doesn't own the tunnel, this ACK is for FWD traffic. */
+    /* The client doesn't own the channel, this ACK is for FWD traffic. */
     t->next_fc.last_ack_recv++;
     tunnel_send_ack (t, GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK, GNUNET_YES);
   }
@@ -5760,7 +5760,6 @@
 }
 
 
-
 /**
  * Iterator over all tunnels to send a monitoring client info about each 
tunnel.
  *
@@ -6089,37 +6088,7 @@
   return GNUNET_YES;
 }
 
-/**
- * Iterator over peer hash map entries to destroy the tunnel during shutdown.
- *
- * @param cls closure
- * @param key current key code
- * @param value value in the hash map
- * @return GNUNET_YES if we should continue to iterate,
- *         GNUNET_NO if not.
- */
-static int
-shutdown_peer (void *cls, const struct GNUNET_HashCode * key, void *value)
-{
-  struct MeshPeer *p = value;
-  struct MeshPeerQueue *q;
-  struct MeshPeerQueue *n;
 
-  q = p->fc->queue_head;
-  while (NULL != q)
-  {
-      n = q->next;
-      if (q->peer == p)
-      {
-        queue_destroy(q, GNUNET_YES);
-      }
-      q = n;
-  }
-  peer_destroy (p);
-  return GNUNET_YES;
-}
-
-
 /**
  * Task run during shutdown.
  *
@@ -6137,7 +6106,6 @@
     core_handle = NULL;
   }
   GNUNET_CONTAINER_multihashmap_iterate (tunnels, &shutdown_tunnel, NULL);
-  GNUNET_CONTAINER_multihashmap_iterate (peers, &shutdown_peer, NULL);
   if (dht_handle != NULL)
   {
     GNUNET_DHT_disconnect (dht_handle);




reply via email to

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