diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-02-13 10:46:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-02-13 10:46:26 +0000 |
commit | 26ea58eb2ef9a90d31e57e054ba26c5968dcb00a (patch) | |
tree | 34a1b59f785490c1c4aa9ad0c4ad0181c71dab09 /src/core/gnunet-service-core_sessions.c | |
parent | d32fe8eefb630ffa6ffd50684b0a59add13cf02f (diff) | |
download | gnunet-26ea58eb2ef9a90d31e57e054ba26c5968dcb00a.tar.gz gnunet-26ea58eb2ef9a90d31e57e054ba26c5968dcb00a.zip |
-trying to fix #2794
Diffstat (limited to 'src/core/gnunet-service-core_sessions.c')
-rw-r--r-- | src/core/gnunet-service-core_sessions.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index 3a603bc81..bea4aad56 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c | |||
@@ -115,13 +115,6 @@ struct Session | |||
115 | struct GSC_TypeMap *tmap; | 115 | struct GSC_TypeMap *tmap; |
116 | 116 | ||
117 | /** | 117 | /** |
118 | * At what time did we initially establish this session? | ||
119 | * (currently unused, should be integrated with ATS in the | ||
120 | * future...). | ||
121 | */ | ||
122 | struct GNUNET_TIME_Absolute time_established; | ||
123 | |||
124 | /** | ||
125 | * Task to transmit corked messages with a delay. | 118 | * Task to transmit corked messages with a delay. |
126 | */ | 119 | */ |
127 | GNUNET_SCHEDULER_TaskIdentifier cork_task; | 120 | GNUNET_SCHEDULER_TaskIdentifier cork_task; |
@@ -137,6 +130,12 @@ struct Session | |||
137 | */ | 130 | */ |
138 | int ready_to_transmit; | 131 | int ready_to_transmit; |
139 | 132 | ||
133 | /** | ||
134 | * Is this the first time we're sending the typemap? If so, | ||
135 | * we want to send it a bit faster the second time. 0 if | ||
136 | * we are sending for the first time, 1 if not. | ||
137 | */ | ||
138 | int first_typemap; | ||
140 | }; | 139 | }; |
141 | 140 | ||
142 | 141 | ||
@@ -226,7 +225,15 @@ transmit_typemap_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
226 | struct GNUNET_MessageHeader *hdr; | 225 | struct GNUNET_MessageHeader *hdr; |
227 | struct GNUNET_TIME_Relative delay; | 226 | struct GNUNET_TIME_Relative delay; |
228 | 227 | ||
229 | delay = TYPEMAP_FREQUENCY; | 228 | if (0 == session->first_typemap) |
229 | { | ||
230 | delay = GNUNET_TIME_UNIT_ZERO; | ||
231 | session->first_typemap = 1; | ||
232 | } | ||
233 | else | ||
234 | { | ||
235 | delay = TYPEMAP_FREQUENCY; | ||
236 | } | ||
230 | /* randomize a bit to avoid spont. sync */ | 237 | /* randomize a bit to avoid spont. sync */ |
231 | delay.rel_value += | 238 | delay.rel_value += |
232 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000); | 239 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000); |
@@ -259,7 +266,6 @@ GSC_SESSIONS_create (const struct GNUNET_PeerIdentity *peer, | |||
259 | session->tmap = GSC_TYPEMAP_create (); | 266 | session->tmap = GSC_TYPEMAP_create (); |
260 | session->peer = *peer; | 267 | session->peer = *peer; |
261 | session->kxinfo = kx; | 268 | session->kxinfo = kx; |
262 | session->time_established = GNUNET_TIME_absolute_get (); | ||
263 | session->typemap_task = | 269 | session->typemap_task = |
264 | GNUNET_SCHEDULER_add_now (&transmit_typemap_task, session); | 270 | GNUNET_SCHEDULER_add_now (&transmit_typemap_task, session); |
265 | GNUNET_assert (GNUNET_OK == | 271 | GNUNET_assert (GNUNET_OK == |