{
struct DisconnectNotifyMessage cnm;
struct Neighbour *n;
+ struct GNUNET_TIME_Relative left;
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
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);
}
*/
#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?
*/