diff options
Diffstat (limited to 'src/namestore/plugin_rest_namestore.c')
-rw-r--r-- | src/namestore/plugin_rest_namestore.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c index cfebd63a7..4612528c6 100644 --- a/src/namestore/plugin_rest_namestore.c +++ b/src/namestore/plugin_rest_namestore.c | |||
@@ -242,6 +242,7 @@ struct RequestHandle | |||
242 | 242 | ||
243 | /** | 243 | /** |
244 | * Cleanup lookup handle | 244 | * Cleanup lookup handle |
245 | * | ||
245 | * @param handle Handle to clean up | 246 | * @param handle Handle to clean up |
246 | */ | 247 | */ |
247 | static void | 248 | static void |
@@ -250,6 +251,7 @@ cleanup_handle (struct RequestHandle *handle) | |||
250 | struct RecordEntry *record_entry; | 251 | struct RecordEntry *record_entry; |
251 | struct RecordEntry *record_tmp; | 252 | struct RecordEntry *record_tmp; |
252 | int i; | 253 | int i; |
254 | |||
253 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 255 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
254 | "Cleaning up\n"); | 256 | "Cleaning up\n"); |
255 | if (NULL != handle->resp_object) | 257 | if (NULL != handle->resp_object) |
@@ -295,6 +297,7 @@ cleanup_handle (struct RequestHandle *handle) | |||
295 | GNUNET_free (handle); | 297 | GNUNET_free (handle); |
296 | } | 298 | } |
297 | 299 | ||
300 | |||
298 | /** | 301 | /** |
299 | * Create json representation of a GNSRECORD | 302 | * Create json representation of a GNSRECORD |
300 | * | 303 | * |
@@ -350,9 +353,9 @@ gnsrecord_to_json (const struct GNUNET_GNSRECORD_Data *rd) | |||
350 | 353 | ||
351 | 354 | ||
352 | /** | 355 | /** |
353 | * Task run on shutdown. Cleans up everything. | 356 | * Task run on error. Generates error response and cleans up. |
354 | * | 357 | * |
355 | * @param cls unused | 358 | * @param cls the request to generate an error response for |
356 | */ | 359 | */ |
357 | static void | 360 | static void |
358 | do_error (void *cls) | 361 | do_error (void *cls) |
@@ -365,6 +368,21 @@ do_error (void *cls) | |||
365 | } | 368 | } |
366 | 369 | ||
367 | 370 | ||
371 | /** | ||
372 | * Task run on timeout. | ||
373 | * | ||
374 | * @param cls the request to time out | ||
375 | */ | ||
376 | static void | ||
377 | do_timeout (void *cls) | ||
378 | { | ||
379 | struct RequestHandle *handle = cls; | ||
380 | |||
381 | handle->timeout_task = NULL; | ||
382 | do_error (handle); | ||
383 | } | ||
384 | |||
385 | |||
368 | static void | 386 | static void |
369 | cleanup_handle_delayed (void *cls) | 387 | cleanup_handle_delayed (void *cls) |
370 | { | 388 | { |
@@ -1138,10 +1156,8 @@ rest_identity_process_request(struct RestConnectionDataHandle *conndata_handle, | |||
1138 | &testservice_id_task, | 1156 | &testservice_id_task, |
1139 | handle); | 1157 | handle); |
1140 | handle->timeout_task = GNUNET_SCHEDULER_add_delayed (handle->timeout, | 1158 | handle->timeout_task = GNUNET_SCHEDULER_add_delayed (handle->timeout, |
1141 | &do_error, | 1159 | &do_timeout, |
1142 | handle); | 1160 | handle); |
1143 | |||
1144 | |||
1145 | } | 1161 | } |
1146 | 1162 | ||
1147 | /** | 1163 | /** |