[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r12253 - in gnunet/src: core include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r12253 - in gnunet/src: core include |
Date: |
Mon, 19 Jul 2010 14:49:02 +0200 |
Author: grothoff
Date: 2010-07-19 14:49:02 +0200 (Mon, 19 Jul 2010)
New Revision: 12253
Modified:
gnunet/src/core/gnunet-service-core.c
gnunet/src/include/gnunet_constants.h
Log:
fast timeout on disconnect
Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c 2010-07-18 20:18:17 UTC (rev
12252)
+++ gnunet/src/core/gnunet-service-core.c 2010-07-19 12:49:02 UTC (rev
12253)
@@ -3717,6 +3717,7 @@
{
struct DisconnectNotifyMessage cnm;
struct Neighbour *n;
+ struct GNUNET_TIME_Relative left;
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -3741,6 +3742,15 @@
gettext_noop ("# peers connected (transport)"),
-1,
GNUNET_NO);
+ if (n->dead_clean_task != GNUNET_SCHEDULER_NO_TASK)
+ GNUNET_SCHEDULER_cancel (sched,
+ n->dead_clean_task);
+ left = GNUNET_CONSTANTS_DISCONNECT_SESSION_TIMEOUT;
+ n->last_activity = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get
(), left);
+ n->dead_clean_task = GNUNET_SCHEDULER_add_delayed (sched,
+ left,
+ &consider_free_task,
+ n);
}
Modified: gnunet/src/include/gnunet_constants.h
===================================================================
--- gnunet/src/include/gnunet_constants.h 2010-07-18 20:18:17 UTC (rev
12252)
+++ gnunet/src/include/gnunet_constants.h 2010-07-19 12:49:02 UTC (rev
12253)
@@ -52,6 +52,12 @@
#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_MINUTES, 5)
/**
+ * After how long do we consider a connection to a peer dead
+ * if we got an explicit disconnect and were unable to reconnect?
+ */
+#define GNUNET_CONSTANTS_DISCONNECT_SESSION_TIMEOUT
GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
+
+/**
* How long do we delay reading more from a peer after a quota violation?
*/
#define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 2)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r12253 - in gnunet/src: core include,
gnunet <=