diff options
-rw-r--r-- | src/fs/gnunet-service-fs.c | 11 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_lc.c | 8 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 24 |
3 files changed, 31 insertions, 12 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index b824e6dc6..6652ecb16 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -400,18 +400,13 @@ start_p2p_processing (void *cls, struct GSF_PendingRequest *pr, | |||
400 | struct GNUNET_SERVER_Client *client = cls; | 400 | struct GNUNET_SERVER_Client *client = cls; |
401 | struct GSF_PendingRequestData *prd; | 401 | struct GSF_PendingRequestData *prd; |
402 | 402 | ||
403 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
404 | if (GNUNET_BLOCK_EVALUATION_OK_LAST == result) | ||
405 | return; /* we're done, 'pr' was already destroyed... */ | ||
403 | prd = GSF_pending_request_get_data_ (pr); | 406 | prd = GSF_pending_request_get_data_ (pr); |
404 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 407 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
405 | "Finished database lookup for local request `%s' with result %d\n", | 408 | "Finished database lookup for local request `%s' with result %d\n", |
406 | GNUNET_h2s (&prd->query), result); | 409 | GNUNET_h2s (&prd->query), result); |
407 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
408 | if (GNUNET_BLOCK_EVALUATION_OK_LAST == result) | ||
409 | return; /* we're done, 'pr' was already destroyed... */ | ||
410 | if (0 != (GSF_PRO_LOCAL_ONLY & prd->options)) | ||
411 | { | ||
412 | GSF_pending_request_cancel_ (pr, GNUNET_YES); | ||
413 | return; | ||
414 | } | ||
415 | if (0 == prd->anonymity_level) | 410 | if (0 == prd->anonymity_level) |
416 | { | 411 | { |
417 | switch (prd->type) | 412 | switch (prd->type) |
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index 0f1d69198..ef30ba32a 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c | |||
@@ -221,7 +221,7 @@ client_request_destroy (void *cls, | |||
221 | * @param last_transmission when was the last time we've tried to download this block? (FOREVER if unknown) | 221 | * @param last_transmission when was the last time we've tried to download this block? (FOREVER if unknown) |
222 | * @param type type of the block | 222 | * @param type type of the block |
223 | * @param data response data, NULL on request expiration | 223 | * @param data response data, NULL on request expiration |
224 | * @param data_len number of bytes in data | 224 | * @param data_len number of bytes in @e data |
225 | */ | 225 | */ |
226 | static void | 226 | static void |
227 | client_response_handler (void *cls, enum GNUNET_BLOCK_EvaluationResult eval, | 227 | client_response_handler (void *cls, enum GNUNET_BLOCK_EvaluationResult eval, |
@@ -240,8 +240,10 @@ client_response_handler (void *cls, enum GNUNET_BLOCK_EvaluationResult eval, | |||
240 | 240 | ||
241 | if (NULL == data) | 241 | if (NULL == data) |
242 | { | 242 | { |
243 | /* ugh, request 'timed out' -- how can this be? */ | 243 | /* local-only request, with no result, clean up. */ |
244 | GNUNET_break (0); | 244 | if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task) |
245 | cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, | ||
246 | cr); | ||
245 | return; | 247 | return; |
246 | } | 248 | } |
247 | prd = GSF_pending_request_get_data_ (pr); | 249 | prd = GSF_pending_request_get_data_ (pr); |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 67c935acd..a9530f53a 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -128,7 +128,7 @@ struct GSF_PendingRequest | |||
128 | GSF_LocalLookupContinuation llc_cont; | 128 | GSF_LocalLookupContinuation llc_cont; |
129 | 129 | ||
130 | /** | 130 | /** |
131 | * Closure for llc_cont. | 131 | * Closure for @e llc_cont. |
132 | */ | 132 | */ |
133 | void *llc_cont_cls; | 133 | void *llc_cont_cls; |
134 | 134 | ||
@@ -1514,6 +1514,28 @@ check_error_and_continue: | |||
1514 | if (NULL == (cont = pr->llc_cont)) | 1514 | if (NULL == (cont = pr->llc_cont)) |
1515 | return; /* no continuation */ | 1515 | return; /* no continuation */ |
1516 | pr->llc_cont = NULL; | 1516 | pr->llc_cont = NULL; |
1517 | if (0 != (GSF_PRO_LOCAL_ONLY & pr->public_data.options)) | ||
1518 | { | ||
1519 | if (GNUNET_BLOCK_EVALUATION_OK_LAST != pr->local_result) | ||
1520 | { | ||
1521 | /* Signal that we are done and that there won't be any | ||
1522 | additional results to allow client to clean up state. */ | ||
1523 | pr->rh (pr->rh_cls, | ||
1524 | GNUNET_BLOCK_EVALUATION_OK_LAST, | ||
1525 | pr, | ||
1526 | UINT32_MAX, | ||
1527 | GNUNET_TIME_UNIT_ZERO_ABS, | ||
1528 | GNUNET_TIME_UNIT_FOREVER_ABS, | ||
1529 | GNUNET_BLOCK_TYPE_ANY, | ||
1530 | NULL, 0); | ||
1531 | } | ||
1532 | /* Finally, call our continuation to signal that we are | ||
1533 | done with local processing of this request; i.e. to | ||
1534 | start reading again from the client. */ | ||
1535 | cont (pr->llc_cont_cls, NULL, GNUNET_BLOCK_EVALUATION_OK_LAST); | ||
1536 | return; | ||
1537 | } | ||
1538 | |||
1517 | cont (pr->llc_cont_cls, pr, pr->local_result); | 1539 | cont (pr->llc_cont_cls, pr, pr->local_result); |
1518 | } | 1540 | } |
1519 | 1541 | ||