gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r19192 - gnunet/src/vpn


From: gnunet
Subject: [GNUnet-SVN] r19192 - gnunet/src/vpn
Date: Tue, 17 Jan 2012 15:45:05 +0100

Author: grothoff
Date: 2012-01-17 15:45:05 +0100 (Tue, 17 Jan 2012)
New Revision: 19192

Modified:
   gnunet/src/vpn/gnunet-service-vpn.c
Log:
-track tmq queue length

Modified: gnunet/src/vpn/gnunet-service-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-service-vpn.c 2012-01-17 14:43:24 UTC (rev 19191)
+++ gnunet/src/vpn/gnunet-service-vpn.c 2012-01-17 14:45:05 UTC (rev 19192)
@@ -195,7 +195,7 @@
   /**
    * Tail of list of messages scheduled for transmission.
    */
-  struct TunnelMessageQueueEntry *tmq_tail;
+  struct TunnelMessageQueueEntry *tmq_tail;  
 
   /**
    * Client that needs to be notified about the tunnel being
@@ -204,6 +204,12 @@
   struct GNUNET_SERVER_Client *client;
 
   /**
+   * Destination entry that has a pointer to this tunnel state;
+   * NULL if this tunnel state is in the tunnel map.
+   */
+  struct DestinationEntry *destination_container;
+
+  /**
    * ID of the client request that caused us to setup this entry.
    */ 
   uint64_t request_id;
@@ -217,15 +223,14 @@
   struct DestinationEntry destination;
 
   /**
-   * Destination entry that has a pointer to this tunnel state;
-   * NULL if this tunnel state is in the tunnel map.
+   * Addess family used for this tunnel on the local TUN interface.
    */
-  struct DestinationEntry *destination_container;
+  int af;
 
   /**
-   * Addess family used for this tunnel on the local TUN interface.
+   * Length of the doubly linked 'tmq_head/tmq_tail' list.
    */
-  int af;
+  unsigned int tmq_length;
 
   /**
    * IPPROTO_TCP or IPPROTO_UDP once bound.
@@ -577,6 +582,7 @@
   GNUNET_CONTAINER_DLL_remove (ts->tmq_head,
                               ts->tmq_tail,
                               tnq);
+  ts->tmq_length--;
   memcpy (buf, tnq->msg, tnq->len);
   ret = tnq->len;
   GNUNET_free (tnq);
@@ -615,6 +621,7 @@
   GNUNET_CONTAINER_DLL_insert_tail (ts->tmq_head,
                                    ts->tmq_tail,
                                    tnq);
+  ts->tmq_length++;
   if (NULL == ts->th)
     ts->th = GNUNET_MESH_notify_transmit_ready (ts->tunnel, 
                                                GNUNET_NO /* cork */,
@@ -1972,8 +1979,10 @@
     GNUNET_CONTAINER_DLL_remove (ts->tmq_head,
                                 ts->tmq_tail,
                                 tnq);
+    ts->tmq_length--;
     GNUNET_free (tnq);
   }
+  GNUNET_assert (0 == ts->tmq_length);
   if (NULL != ts->client)
   {
     GNUNET_SERVER_client_drop (ts->client);




reply via email to

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