aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-04-21 13:29:22 +0000
committerChristian Grothoff <christian@grothoff.org>2011-04-21 13:29:22 +0000
commitef98e4c68e05e88ced677d66b9e5b57a382df70d (patch)
tree64f88544acb7180ba2ca639050059bbb01252e65 /src
parent8b23412a0e353778e83b370260e40d63a18c3927 (diff)
downloadgnunet-ef98e4c68e05e88ced677d66b9e5b57a382df70d.tar.gz
gnunet-ef98e4c68e05e88ced677d66b9e5b57a382df70d.zip
fix
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs_download.c2
-rw-r--r--src/fs/gnunet-service-fs_cp.c13
-rw-r--r--src/fs/gnunet-service-fs_lc.c14
-rw-r--r--src/fs/gnunet-service-fs_pr.c4
-rw-r--r--src/fs/gnunet-service-fs_pr.h2
5 files changed, 33 insertions, 2 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 8192b8c1f..785803edf 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -31,7 +31,7 @@
31#include "fs.h" 31#include "fs.h"
32#include "fs_tree.h" 32#include "fs_tree.h"
33 33
34#define DEBUG_DOWNLOAD GNUNET_NO 34#define DEBUG_DOWNLOAD GNUNET_YES
35 35
36/** 36/**
37 * Determine if the given download (options and meta data) should cause 37 * Determine if the given download (options and meta data) should cause
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 92461e477..5aba83298 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -616,6 +616,7 @@ copy_reply (void *cls,
616 * 616 *
617 * @param cls 'struct GSF_ConnectedPeer' of the peer that would 617 * @param cls 'struct GSF_ConnectedPeer' of the peer that would
618 * have liked an answer to the request 618 * have liked an answer to the request
619 * @param eval evaluation of the result
619 * @param pr handle to the original pending request 620 * @param pr handle to the original pending request
620 * @param expiration when does 'data' expire? 621 * @param expiration when does 'data' expire?
621 * @param type type of the block 622 * @param type type of the block
@@ -624,6 +625,7 @@ copy_reply (void *cls,
624 */ 625 */
625static void 626static void
626handle_p2p_reply (void *cls, 627handle_p2p_reply (void *cls,
628 enum GNUNET_BLOCK_EvaluationResult eval,
627 struct GSF_PendingRequest *pr, 629 struct GSF_PendingRequest *pr,
628 struct GNUNET_TIME_Absolute expiration, 630 struct GNUNET_TIME_Absolute expiration,
629 enum GNUNET_BLOCK_Type type, 631 enum GNUNET_BLOCK_Type type,
@@ -683,6 +685,17 @@ handle_p2p_reply (void *cls,
683 msize, 685 msize,
684 &copy_reply, 686 &copy_reply,
685 pm); 687 pm);
688 if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)
689 return;
690 GNUNET_STATISTICS_update (GSF_stats,
691 gettext_noop ("# P2P searches active"),
692 -1,
693 GNUNET_NO);
694 GNUNET_break (GNUNET_OK ==
695 GNUNET_CONTAINER_multihashmap_remove (cp->request_map,
696 &prd->query,
697 pr));
698 GSF_pending_request_cancel_ (pr);
686} 699}
687 700
688 701
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index 3908b8a55..58a1a0933 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -188,6 +188,7 @@ GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client)
188 * expiration. 188 * expiration.
189 * 189 *
190 * @param cls user-specified closure 190 * @param cls user-specified closure
191 * @param eval evaluation of the result
191 * @param pr handle to the original pending request 192 * @param pr handle to the original pending request
192 * @param expiration when does 'data' expire? 193 * @param expiration when does 'data' expire?
193 * @param type type of the block 194 * @param type type of the block
@@ -196,6 +197,7 @@ GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client)
196 */ 197 */
197static void 198static void
198client_response_handler (void *cls, 199client_response_handler (void *cls,
200 enum GNUNET_BLOCK_EvaluationResult eval,
199 struct GSF_PendingRequest *pr, 201 struct GSF_PendingRequest *pr,
200 struct GNUNET_TIME_Absolute expiration, 202 struct GNUNET_TIME_Absolute expiration,
201 enum GNUNET_BLOCK_Type type, 203 enum GNUNET_BLOCK_Type type,
@@ -242,6 +244,18 @@ client_response_handler (void *cls,
242 GNUNET_h2s (&prd->query), 244 GNUNET_h2s (&prd->query),
243 (unsigned int) prd->type); 245 (unsigned int) prd->type);
244#endif 246#endif
247 if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)
248 return;
249 GNUNET_CONTAINER_DLL_remove (lc->cr_head,
250 lc->cr_tail,
251 cr);
252 GSF_pending_request_cancel_ (cr->pr);
253 GNUNET_STATISTICS_update (GSF_stats,
254 gettext_noop ("# client searches active"),
255 - 1,
256 GNUNET_NO);
257 GNUNET_free (cr);
258
245} 259}
246 260
247 261
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index f8ca82800..f327d9b4b 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -338,6 +338,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
338 if (pr == dpr) 338 if (pr == dpr)
339 break; /* let the request live briefly... */ 339 break; /* let the request live briefly... */
340 dpr->rh (dpr->rh_cls, 340 dpr->rh (dpr->rh_cls,
341 GNUNET_BLOCK_EVALUATION_REQUEST_VALID,
341 dpr, 342 dpr,
342 GNUNET_TIME_UNIT_FOREVER_ABS, 343 GNUNET_TIME_UNIT_FOREVER_ABS,
343 GNUNET_BLOCK_TYPE_ANY, 344 GNUNET_BLOCK_TYPE_ANY,
@@ -705,11 +706,11 @@ process_reply (void *cls,
705 GNUNET_TIME_absolute_get_duration (pr->public_data.start_time).rel_value); 706 GNUNET_TIME_absolute_get_duration (pr->public_data.start_time).rel_value);
706 /* pass on to other peers / local clients */ 707 /* pass on to other peers / local clients */
707 pr->rh (pr->rh_cls, 708 pr->rh (pr->rh_cls,
709 prq->eval,
708 pr, 710 pr,
709 prq->expiration, 711 prq->expiration,
710 prq->type, 712 prq->type,
711 prq->data, prq->size); 713 prq->data, prq->size);
712 GSF_pending_request_cancel_ (pr);
713 return GNUNET_YES; 714 return GNUNET_YES;
714 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: 715 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
715 GNUNET_STATISTICS_update (GSF_stats, 716 GNUNET_STATISTICS_update (GSF_stats,
@@ -764,6 +765,7 @@ process_reply (void *cls,
764 prq->request_found = GNUNET_YES; 765 prq->request_found = GNUNET_YES;
765 /* finally, pass on to other peer / local client */ 766 /* finally, pass on to other peer / local client */
766 pr->rh (pr->rh_cls, 767 pr->rh (pr->rh_cls,
768 prq->eval,
767 pr, 769 pr,
768 prq->expiration, 770 prq->expiration,
769 prq->type, 771 prq->type,
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h
index b546fc1ab..fa3c51ffd 100644
--- a/src/fs/gnunet-service-fs_pr.h
+++ b/src/fs/gnunet-service-fs_pr.h
@@ -158,6 +158,7 @@ struct GSF_PendingRequestData
158 * expiration. 158 * expiration.
159 * 159 *
160 * @param cls user-specified closure 160 * @param cls user-specified closure
161 * @param eval evaluation of the result
161 * @param pr handle to the original pending request 162 * @param pr handle to the original pending request
162 * @param expiration when does 'data' expire? 163 * @param expiration when does 'data' expire?
163 * @param type type of the block 164 * @param type type of the block
@@ -165,6 +166,7 @@ struct GSF_PendingRequestData
165 * @param data_len number of bytes in data 166 * @param data_len number of bytes in data
166 */ 167 */
167typedef void (*GSF_PendingRequestReplyHandler)(void *cls, 168typedef void (*GSF_PendingRequestReplyHandler)(void *cls,
169 enum GNUNET_BLOCK_EvaluationResult eval,
168 struct GSF_PendingRequest *pr, 170 struct GSF_PendingRequest *pr,
169 struct GNUNET_TIME_Absolute expiration, 171 struct GNUNET_TIME_Absolute expiration,
170 enum GNUNET_BLOCK_Type type, 172 enum GNUNET_BLOCK_Type type,