diff options
Diffstat (limited to 'src/hostlist/gnunet-daemon-hostlist_server.c')
-rw-r--r-- | src/hostlist/gnunet-daemon-hostlist_server.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c index 4c276ce80..f383ec394 100644 --- a/src/hostlist/gnunet-daemon-hostlist_server.c +++ b/src/hostlist/gnunet-daemon-hostlist_server.c | |||
@@ -195,11 +195,10 @@ host_processor (void *cls, | |||
195 | { | 195 | { |
196 | size_t old; | 196 | size_t old; |
197 | size_t s; | 197 | size_t s; |
198 | struct GNUNET_HELLO_Builder *hello_builder; | ||
199 | struct GNUNET_MessageHeader *hello; | 198 | struct GNUNET_MessageHeader *hello; |
200 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); | 199 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); |
201 | struct GNUNET_TIME_Absolute hello_exp; | 200 | struct GNUNET_TIME_Absolute hello_exp; |
202 | 201 | ||
203 | if (NULL != emsg) | 202 | if (NULL != emsg) |
204 | { | 203 | { |
205 | GNUNET_assert (NULL == &record->peer); | 204 | GNUNET_assert (NULL == &record->peer); |
@@ -226,19 +225,17 @@ host_processor (void *cls, | |||
226 | GNUNET_break (0); | 225 | GNUNET_break (0); |
227 | return; | 226 | return; |
228 | } | 227 | } |
229 | hello_builder = GNUNET_HELLO_builder_new (&record->peer); | 228 | hello_exp = GNUNET_HELLO_builder_get_expiration_time (hello); |
230 | hello_exp = GNUNET_HELLO_builder_get_expiration_time (hello_builder, hello); | 229 | if (GNUNET_TIME_absolute_cmp (hello_exp, <, now)) |
231 | if (GNUNET_TIME_absolute_cmp (hello_exp, < , now)) | ||
232 | { | 230 | { |
233 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 231 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
234 | "HELLO for peer `%4s' has expired address, not suitable for hostlist!\n", | 232 | "HELLO for peer `%4s' has expired address, not suitable for hostlist!\n", |
235 | GNUNET_i2s (&record->peer)); | 233 | GNUNET_i2s (&record->peer)); |
236 | GNUNET_STATISTICS_update (stats, | 234 | GNUNET_STATISTICS_update (stats, |
237 | gettext_noop ( | 235 | gettext_noop ( |
238 | "Expired HELLO encountered (ignored)"), | 236 | "Expired HELLO encountered (ignored)"), |
239 | 1, | 237 | 1, |
240 | GNUNET_NO); | 238 | GNUNET_NO); |
241 | GNUNET_HELLO_builder_free (hello_builder); | ||
242 | return; | 239 | return; |
243 | } | 240 | } |
244 | } | 241 | } |
@@ -258,7 +255,6 @@ host_processor (void *cls, | |||
258 | "bytes not included in hostlist (size limit)"), | 255 | "bytes not included in hostlist (size limit)"), |
259 | s, | 256 | s, |
260 | GNUNET_NO); | 257 | GNUNET_NO); |
261 | GNUNET_HELLO_builder_free (hello_builder); | ||
262 | return; | 258 | return; |
263 | } | 259 | } |
264 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 260 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
@@ -267,7 +263,6 @@ host_processor (void *cls, | |||
267 | (unsigned int) s); | 263 | (unsigned int) s); |
268 | GNUNET_array_grow (builder->data, builder->size, old + s); | 264 | GNUNET_array_grow (builder->data, builder->size, old + s); |
269 | GNUNET_memcpy (&builder->data[old], hello, s); | 265 | GNUNET_memcpy (&builder->data[old], hello, s); |
270 | GNUNET_HELLO_builder_free (hello_builder); | ||
271 | } | 266 | } |
272 | 267 | ||
273 | 268 | ||