gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10225 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r10225 - gnunet/src/core
Date: Fri, 5 Feb 2010 14:14:21 +0100

Author: nevans
Date: 2010-02-05 14:14:21 +0100 (Fri, 05 Feb 2010)
New Revision: 10225

Modified:
   gnunet/src/core/gnunet-service-core.c
Log:
set last activity to now to give a bit of leeway for a connection to happen...

Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c       2010-02-05 12:19:58 UTC (rev 
10224)
+++ gnunet/src/core/gnunet-service-core.c       2010-02-05 13:14:21 UTC (rev 
10225)
@@ -2939,7 +2939,14 @@
   /* check if we want to disconnect for good due to inactivity */
   if ( (GNUNET_TIME_absolute_get_duration (n->last_activity).value > 
GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.value) &&
        (GNUNET_TIME_absolute_get_duration (n->time_established).value > 
GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.value) )
-    q_in = 0; /* force disconnect */
+    {
+#if DEBUG_CORE
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Forcing disconnect of `%4s' due to inactivity (?).\n",
+              GNUNET_i2s (&n->peer));
+#endif
+      q_in = 0; /* force disconnect */
+    }
   if ( (n->bpm_in + MIN_BPM_CHANGE < q_in) ||
        (n->bpm_in - MIN_BPM_CHANGE > q_in) ) 
     {
@@ -2992,6 +2999,7 @@
   GNUNET_CRYPTO_aes_create_session_key (&n->encrypt_key);
   n->encrypt_key_created = now;
   n->set_key_retry_frequency = INITIAL_SET_KEY_RETRY_FREQUENCY;
+  n->last_activity = now;
   n->last_asw_update = now;
   n->last_arw_update = now;
   n->bpm_in = GNUNET_CONSTANTS_DEFAULT_BPM_IN_OUT;





reply via email to

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