diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-02-05 13:14:21 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-02-05 13:14:21 +0000 |
commit | 9e85aa70d212bfed69a33b436f3794947cc11968 (patch) | |
tree | 11043a8dac319ba2f4308a3b5f88551c27e19ce1 /src | |
parent | 5859cd211fe5d6f5f245def955760d20bbce9380 (diff) | |
download | gnunet-9e85aa70d212bfed69a33b436f3794947cc11968.tar.gz gnunet-9e85aa70d212bfed69a33b436f3794947cc11968.zip |
set last activity to now to give a bit of leeway for a connection to happen...
Diffstat (limited to 'src')
-rw-r--r-- | src/core/gnunet-service-core.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index aaedf3f38..0150ec8f3 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -2939,7 +2939,14 @@ neighbour_quota_update (void *cls, | |||
2939 | /* check if we want to disconnect for good due to inactivity */ | 2939 | /* check if we want to disconnect for good due to inactivity */ |
2940 | if ( (GNUNET_TIME_absolute_get_duration (n->last_activity).value > GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.value) && | 2940 | if ( (GNUNET_TIME_absolute_get_duration (n->last_activity).value > GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.value) && |
2941 | (GNUNET_TIME_absolute_get_duration (n->time_established).value > GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.value) ) | 2941 | (GNUNET_TIME_absolute_get_duration (n->time_established).value > GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.value) ) |
2942 | q_in = 0; /* force disconnect */ | 2942 | { |
2943 | #if DEBUG_CORE | ||
2944 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2945 | "Forcing disconnect of `%4s' due to inactivity (?).\n", | ||
2946 | GNUNET_i2s (&n->peer)); | ||
2947 | #endif | ||
2948 | q_in = 0; /* force disconnect */ | ||
2949 | } | ||
2943 | if ( (n->bpm_in + MIN_BPM_CHANGE < q_in) || | 2950 | if ( (n->bpm_in + MIN_BPM_CHANGE < q_in) || |
2944 | (n->bpm_in - MIN_BPM_CHANGE > q_in) ) | 2951 | (n->bpm_in - MIN_BPM_CHANGE > q_in) ) |
2945 | { | 2952 | { |
@@ -2992,6 +2999,7 @@ handle_transport_notify_connect (void *cls, | |||
2992 | GNUNET_CRYPTO_aes_create_session_key (&n->encrypt_key); | 2999 | GNUNET_CRYPTO_aes_create_session_key (&n->encrypt_key); |
2993 | n->encrypt_key_created = now; | 3000 | n->encrypt_key_created = now; |
2994 | n->set_key_retry_frequency = INITIAL_SET_KEY_RETRY_FREQUENCY; | 3001 | n->set_key_retry_frequency = INITIAL_SET_KEY_RETRY_FREQUENCY; |
3002 | n->last_activity = now; | ||
2995 | n->last_asw_update = now; | 3003 | n->last_asw_update = now; |
2996 | n->last_arw_update = now; | 3004 | n->last_arw_update = now; |
2997 | n->bpm_in = GNUNET_CONSTANTS_DEFAULT_BPM_IN_OUT; | 3005 | n->bpm_in = GNUNET_CONSTANTS_DEFAULT_BPM_IN_OUT; |