gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10622 - in gnunet/src: core include transport


From: gnunet
Subject: [GNUnet-SVN] r10622 - in gnunet/src: core include transport
Date: Tue, 16 Mar 2010 15:57:39 +0100

Author: grothoff
Date: 2010-03-16 15:57:39 +0100 (Tue, 16 Mar 2010)
New Revision: 10622

Modified:
   gnunet/src/core/gnunet-service-core.c
   gnunet/src/include/gnunet_transport_service.h
   gnunet/src/transport/gnunet-service-transport.c
Log:
stuff

Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c       2010-03-16 14:50:32 UTC (rev 
10621)
+++ gnunet/src/core/gnunet-service-core.c       2010-03-16 14:57:39 UTC (rev 
10622)
@@ -1104,7 +1104,7 @@
   if (n->keep_alive_task != GNUNET_SCHEDULER_NO_TASK)    
       GNUNET_SCHEDULER_cancel (sched, n->keep_alive_task);
   if (n->status == PEER_STATE_KEY_CONFIRMED)
-    GNUNET_STATISTICS_update (stats, gettext_noop ("# peers connected"), -1, 
GNUNET_NO);
+    GNUNET_STATISTICS_update (stats, gettext_noop ("# established sessions"), 
-1, GNUNET_NO);
   GNUNET_free_non_null (n->public_key);
   GNUNET_free_non_null (n->pending_ping);
   GNUNET_free_non_null (n->pending_pong);
@@ -1319,7 +1319,9 @@
   char *cbuf;
 
   n->th = NULL;
-  GNUNET_assert (NULL != (m = n->encrypted_head));
+  m = n->encrypted_head;
+  if (m == NULL)
+    return 0;
   GNUNET_CONTAINER_DLL_remove (n->encrypted_head,
                               n->encrypted_tail,
                               m);
@@ -2412,7 +2414,23 @@
 #endif
       return; /* already in progress */
     }
-
+  if (! n->is_connected)
+    {
+      if (NULL == n->th)
+       {
+         GNUNET_STATISTICS_update (stats, 
+                                   gettext_noop ("# Asking transport to 
connect (for SETKEY)"), 
+                                   1, 
+                                   GNUNET_NO);
+         n->th = GNUNET_TRANSPORT_notify_transmit_ready (transport,
+                                                         &n->peer,
+                                                         sizeof (struct 
SetKeyMessage) + sizeof (struct PingMessage),
+                                                         
GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
+                                                         
&notify_encrypted_transmit_ready,
+                                                         n);
+       }
+      return; 
+    }
 #if DEBUG_CORE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Asked to perform key exchange with `%4s'.\n",
@@ -3403,7 +3421,7 @@
       n->last_activity = now;
       if (!up)
        {
-         GNUNET_STATISTICS_update (stats, gettext_noop ("# peers connected"), 
1, GNUNET_NO);
+         GNUNET_STATISTICS_update (stats, gettext_noop ("# established 
sessions"), 1, GNUNET_NO);
          n->time_established = now;
        }
       if (n->keep_alive_task != GNUNET_SCHEDULER_NO_TASK)
@@ -3527,6 +3545,10 @@
     {
       n = create_neighbour (peer);
     }
+  GNUNET_STATISTICS_update (stats, 
+                           gettext_noop ("# peers connected"), 
+                           1, 
+                           GNUNET_NO);
   n->is_connected = GNUNET_YES;      
   n->last_latency = latency;
   n->last_distance = distance;
@@ -3587,6 +3609,10 @@
   cnm.peer = *peer;
   send_to_all_clients (&cnm.header, GNUNET_YES, 
GNUNET_CORE_OPTION_SEND_DISCONNECT);
   n->is_connected = GNUNET_NO;
+  GNUNET_STATISTICS_update (stats, 
+                           gettext_noop ("# peers connected"), 
+                           -1, 
+                           GNUNET_NO);
 }
 
 

Modified: gnunet/src/include/gnunet_transport_service.h
===================================================================
--- gnunet/src/include/gnunet_transport_service.h       2010-03-16 14:50:32 UTC 
(rev 10621)
+++ gnunet/src/include/gnunet_transport_service.h       2010-03-16 14:57:39 UTC 
(rev 10622)
@@ -179,9 +179,9 @@
 
 /**
  * Check if we could queue a message of the given size for
- * transmission.  The transport service will take both its
- * internal buffers and bandwidth limits imposed by the
- * other peer into consideration when answering this query.
+ * transmission.  The transport service will take both its internal
+ * buffers and bandwidth limits imposed by the other peer into
+ * consideration when answering this query.
  *
  * @param handle connection to transport service
  * @param target who should receive the message

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2010-03-16 14:50:32 UTC 
(rev 10621)
+++ gnunet/src/transport/gnunet-service-transport.c     2010-03-16 14:57:39 UTC 
(rev 10622)
@@ -1066,7 +1066,11 @@
 {
   struct MessageQueue *mq = cls;
   struct NeighbourList *n;
-
+  
+  GNUNET_STATISTICS_update (stats,
+                           gettext_noop ("# bytes pending with plugins"),
+                           -mq->message_buf_size,
+                           GNUNET_NO);
   if (result == GNUNET_OK)
     {
       GNUNET_STATISTICS_update (stats,
@@ -1303,7 +1307,7 @@
                            -mq->message_buf_size,
                            GNUNET_NO);
   GNUNET_STATISTICS_update (stats,
-                           gettext_noop ("# bytes transmitted to other peers"),
+                           gettext_noop ("# bytes pending with plugins"),
                            mq->message_buf_size,
                            GNUNET_NO);
   rl->plugin->api->send (rl->plugin->api->cls,
@@ -2583,7 +2587,7 @@
   else
     {
       GNUNET_STATISTICS_update (stats,
-                               gettext_noop ("# no existing neighbour record 
while validating HELLO"),
+                               gettext_noop ("# no existing neighbour record 
(validating HELLO)"),
                                1,
                                GNUNET_NO);      
     }





reply via email to

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