diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-25 08:18:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-25 08:18:47 +0000 |
commit | 2574474f98d5a4feefab2bbd7092c9d0ff9d64e8 (patch) | |
tree | bb769a4ade0c1017940a557faf8611aaf043bc64 /src/fs | |
parent | f094448e150652facb82024f45dea7193650c2bc (diff) | |
download | gnunet-2574474f98d5a4feefab2bbd7092c9d0ff9d64e8.tar.gz gnunet-2574474f98d5a4feefab2bbd7092c9d0ff9d64e8.zip |
fixes
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs_lc.c | 17 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_new.c | 8 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 15 |
3 files changed, 36 insertions, 4 deletions
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index 2b069d9ca..8727670e8 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c | |||
@@ -232,12 +232,23 @@ client_response_handler (void *cls, | |||
232 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); | 232 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); |
233 | memcpy (&pm[1], data, data_len); | 233 | memcpy (&pm[1], data, data_len); |
234 | GSF_local_client_transmit_ (lc, &pm->header); | 234 | GSF_local_client_transmit_ (lc, &pm->header); |
235 | 235 | #if DEBUG_FS | |
236 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
237 | "Queued reply to query `%s' for local client\n", | ||
238 | GNUNET_h2s (&prd->query), | ||
239 | (unsigned int) prd->type); | ||
240 | #endif | ||
236 | if (GNUNET_NO == more) | 241 | if (GNUNET_NO == more) |
237 | { | 242 | { |
238 | GNUNET_CONTAINER_DLL_remove (lc->cr_head, | 243 | GNUNET_CONTAINER_DLL_remove (lc->cr_head, |
239 | lc->cr_tail, | 244 | lc->cr_tail, |
240 | cr); | 245 | cr); |
246 | GNUNET_SERVER_receive_done (lc->client, | ||
247 | GNUNET_OK); | ||
248 | GNUNET_STATISTICS_update (GSF_stats, | ||
249 | gettext_noop ("# client searches active"), | ||
250 | - 1, | ||
251 | GNUNET_NO); | ||
241 | GNUNET_free (cr); | 252 | GNUNET_free (cr); |
242 | } | 253 | } |
243 | } | 254 | } |
@@ -469,6 +480,10 @@ GSF_client_disconnect_handler_ (void *cls, | |||
469 | pos->cr_tail, | 480 | pos->cr_tail, |
470 | cr); | 481 | cr); |
471 | GSF_pending_request_cancel_ (cr->pr); | 482 | GSF_pending_request_cancel_ (cr->pr); |
483 | GNUNET_STATISTICS_update (GSF_stats, | ||
484 | gettext_noop ("# client searches active"), | ||
485 | - 1, | ||
486 | GNUNET_NO); | ||
472 | GNUNET_free (cr); | 487 | GNUNET_free (cr); |
473 | } | 488 | } |
474 | while (NULL != (res = pos->res_head)) | 489 | while (NULL != (res = pos->res_head)) |
diff --git a/src/fs/gnunet-service-fs_new.c b/src/fs/gnunet-service-fs_new.c index 0f5931a19..94a5ff2bf 100644 --- a/src/fs/gnunet-service-fs_new.c +++ b/src/fs/gnunet-service-fs_new.c | |||
@@ -339,11 +339,17 @@ start_p2p_processing (void *cls, | |||
339 | struct GNUNET_SERVER_Client *client = cls; | 339 | struct GNUNET_SERVER_Client *client = cls; |
340 | struct GSF_PendingRequestData *prd; | 340 | struct GSF_PendingRequestData *prd; |
341 | 341 | ||
342 | prd = GSF_pending_request_get_data_ (pr); | ||
343 | #if DEBUG_FS | ||
344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
345 | "Finished database lookup for local request `%s' with result %d\n", | ||
346 | GNUNET_h2s (&prd->query), | ||
347 | result); | ||
348 | #endif | ||
342 | GNUNET_SERVER_receive_done (client, | 349 | GNUNET_SERVER_receive_done (client, |
343 | GNUNET_OK); | 350 | GNUNET_OK); |
344 | if (GNUNET_BLOCK_EVALUATION_OK_LAST == result) | 351 | if (GNUNET_BLOCK_EVALUATION_OK_LAST == result) |
345 | return; /* we're done, 'pr' was already destroyed... */ | 352 | return; /* we're done, 'pr' was already destroyed... */ |
346 | prd = GSF_pending_request_get_data_ (pr); | ||
347 | if (0 != (GSF_PRO_LOCAL_ONLY & prd->options) ) | 353 | if (0 != (GSF_PRO_LOCAL_ONLY & prd->options) ) |
348 | { | 354 | { |
349 | GSF_pending_request_cancel_ (pr); | 355 | GSF_pending_request_cancel_ (pr); |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index d8cd8716e..c3116ba23 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -1034,10 +1034,21 @@ process_local_reply (void *cls, | |||
1034 | GSF_update_datastore_delay_ (pr->public_data.start_time); | 1034 | GSF_update_datastore_delay_ (pr->public_data.start_time); |
1035 | process_reply (&prq, key, pr); | 1035 | process_reply (&prq, key, pr); |
1036 | if (prq.finished == GNUNET_YES) | 1036 | if (prq.finished == GNUNET_YES) |
1037 | return; | 1037 | { |
1038 | #if DEBUG_FS | ||
1039 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1040 | "Request processing finished, not asking datastore for more\n"); | ||
1041 | #endif | ||
1042 | return; | ||
1043 | } | ||
1038 | pr->local_result = prq.eval; | 1044 | pr->local_result = prq.eval; |
1039 | if (pr->qe == NULL) | 1045 | if (pr->qe == NULL) |
1040 | return; /* done here */ | 1046 | { |
1047 | #if DEBUG_FS | ||
1048 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1049 | "Request cancelled, not asking datastore for more\n"); | ||
1050 | #endif | ||
1051 | } | ||
1041 | if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST) | 1052 | if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST) |
1042 | { | 1053 | { |
1043 | GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_NO); | 1054 | GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_NO); |