diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-04-21 13:05:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-04-21 13:05:22 +0000 |
commit | 8b23412a0e353778e83b370260e40d63a18c3927 (patch) | |
tree | b2d8321ff0117ce7e394ec6c57e74d6c7d48be57 /src | |
parent | a8fbbd5cba5913f69c6f16e43c7c8cc8165a1f2a (diff) | |
download | gnunet-8b23412a0e353778e83b370260e40d63a18c3927.tar.gz gnunet-8b23412a0e353778e83b370260e40d63a18c3927.zip |
cancel completed requests
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 8 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 14 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 15 |
3 files changed, 28 insertions, 9 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 2aec83efe..92461e477 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -857,12 +857,6 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
857 | return NULL; | 857 | return NULL; |
858 | } | 858 | } |
859 | gm = (const struct GetMessage*) message; | 859 | gm = (const struct GetMessage*) message; |
860 | #if DEBUG_FS | ||
861 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
862 | "Received request for `%s' from `%s'\n", | ||
863 | GNUNET_h2s (&gm->query), | ||
864 | GNUNET_i2s (other)); | ||
865 | #endif | ||
866 | type = ntohl (gm->type); | 860 | type = ntohl (gm->type); |
867 | bm = ntohl (gm->hash_bitmap); | 861 | bm = ntohl (gm->hash_bitmap); |
868 | bits = 0; | 862 | bits = 0; |
@@ -1551,7 +1545,7 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
1551 | { | 1545 | { |
1552 | #if DEBUG_FS && 0 | 1546 | #if DEBUG_FS && 0 |
1553 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1547 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1554 | "Migration already blocked for another %llu ms\n", | 1548 | "Migration already blocked for another %llu ms\n", |
1555 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (cp->last_migration_block).rel_value); | 1549 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (cp->last_migration_block).rel_value); |
1556 | #endif | 1550 | #endif |
1557 | return; /* already blocked */ | 1551 | return; /* already blocked */ |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index d0e30f025..b3f46cf45 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -134,7 +134,19 @@ plan (struct PeerPlan *pp, | |||
134 | 134 | ||
135 | prd = GSF_pending_request_get_data_ (rp->pr); | 135 | prd = GSF_pending_request_get_data_ (rp->pr); |
136 | // FIXME: calculate 'rp->earliest_transmission'! | 136 | // FIXME: calculate 'rp->earliest_transmission'! |
137 | // fIXME: claculate 'rp->priority'! | 137 | // FIXME: claculate 'rp->priority'! |
138 | rp->earliest_transmission | ||
139 | = GNUNET_TIME_relative_to_absolute | ||
140 | (GNUNET_TIME_relative_multiply | ||
141 | (GNUNET_TIME_UNIT_SECONDS, | ||
142 | rp->transmission_counter)); | ||
143 | #if DEBUG_FS | ||
144 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
145 | "Earliest (re)transmission for `%s' in %us\n", | ||
146 | GNUNET_h2s (&prd->query), | ||
147 | rp->transmission_counter); | ||
148 | #endif | ||
149 | |||
138 | 150 | ||
139 | if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value == 0) | 151 | if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value == 0) |
140 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, | 152 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 16389e130..f8ca82800 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -266,6 +266,12 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
266 | struct GSF_PendingRequest *pr; | 266 | struct GSF_PendingRequest *pr; |
267 | struct GSF_PendingRequest *dpr; | 267 | struct GSF_PendingRequest *dpr; |
268 | 268 | ||
269 | #if DEBUG_FS | ||
270 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
271 | "Creating request handle for `%s' of type %d\n", | ||
272 | GNUNET_h2s (query), | ||
273 | type); | ||
274 | #endif | ||
269 | pr = GNUNET_malloc (sizeof (struct GSF_PendingRequest)); | 275 | pr = GNUNET_malloc (sizeof (struct GSF_PendingRequest)); |
270 | pr->public_data.query = *query; | 276 | pr->public_data.query = *query; |
271 | if (GNUNET_BLOCK_TYPE_FS_SBLOCK == type) | 277 | if (GNUNET_BLOCK_TYPE_FS_SBLOCK == type) |
@@ -446,7 +452,13 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
446 | int64_t ttl; | 452 | int64_t ttl; |
447 | int do_route; | 453 | int do_route; |
448 | 454 | ||
449 | 455 | #if DEBUG_FS | |
456 | if (buf_size > 0) | ||
457 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
458 | "Building request message for `%s' of type %d\n", | ||
459 | GNUNET_h2s (&pr->public_data.query), | ||
460 | pr->public_data.type); | ||
461 | #endif | ||
450 | k = 0; | 462 | k = 0; |
451 | bm = 0; | 463 | bm = 0; |
452 | do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); | 464 | do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); |
@@ -697,6 +709,7 @@ process_reply (void *cls, | |||
697 | prq->expiration, | 709 | prq->expiration, |
698 | prq->type, | 710 | prq->type, |
699 | prq->data, prq->size); | 711 | prq->data, prq->size); |
712 | GSF_pending_request_cancel_ (pr); | ||
700 | return GNUNET_YES; | 713 | return GNUNET_YES; |
701 | case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: | 714 | case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: |
702 | GNUNET_STATISTICS_update (GSF_stats, | 715 | GNUNET_STATISTICS_update (GSF_stats, |