diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-11 16:23:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-11 16:23:52 +0000 |
commit | 64821d4ae43b03b30de3dd136137598c0d5a2ab2 (patch) | |
tree | 1ed54d5721882d5f1e6bf225616d202d9d8a7b08 /src/fs/gnunet-service-fs_pr.c | |
parent | d984e2895f96f67fe2c44f27cdacfbb404485ada (diff) | |
download | gnunet-64821d4ae43b03b30de3dd136137598c0d5a2ab2.tar.gz gnunet-64821d4ae43b03b30de3dd136137598c0d5a2ab2.zip |
stuff
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 0fdcd0cf1..ff2f7a3a3 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -423,14 +423,12 @@ GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | |||
423 | * transmission to other peers (or at least determine its size). | 423 | * transmission to other peers (or at least determine its size). |
424 | * | 424 | * |
425 | * @param pr request to generate the message for | 425 | * @param pr request to generate the message for |
426 | * @param do_route are we routing the reply | ||
427 | * @param buf_size number of bytes available in buf | 426 | * @param buf_size number of bytes available in buf |
428 | * @param buf where to copy the message (can be NULL) | 427 | * @param buf where to copy the message (can be NULL) |
429 | * @return number of bytes needed (if > buf_size) or used | 428 | * @return number of bytes needed (if > buf_size) or used |
430 | */ | 429 | */ |
431 | size_t | 430 | size_t |
432 | GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | 431 | GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, |
433 | int do_route, | ||
434 | size_t buf_size, | 432 | size_t buf_size, |
435 | void *buf) | 433 | void *buf) |
436 | { | 434 | { |
@@ -444,10 +442,13 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
444 | size_t bf_size; | 442 | size_t bf_size; |
445 | struct GNUNET_TIME_Absolute now; | 443 | struct GNUNET_TIME_Absolute now; |
446 | int64_t ttl; | 444 | int64_t ttl; |
445 | int do_route; | ||
446 | |||
447 | 447 | ||
448 | k = 0; | 448 | k = 0; |
449 | bm = 0; | 449 | bm = 0; |
450 | if (GNUNET_YES != do_route) | 450 | do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); |
451 | if (! do_route) | ||
451 | { | 452 | { |
452 | bm |= GET_MESSAGE_BIT_RETURN_TO; | 453 | bm |= GET_MESSAGE_BIT_RETURN_TO; |
453 | k++; | 454 | k++; |
@@ -471,7 +472,7 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
471 | gm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_GET); | 472 | gm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_GET); |
472 | gm->header.size = htons (msize); | 473 | gm->header.size = htons (msize); |
473 | gm->type = htonl (pr->public_data.type); | 474 | gm->type = htonl (pr->public_data.type); |
474 | if (GNUNET_YES == do_route) | 475 | if (do_route) |
475 | prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | 476 | prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, |
476 | pr->public_data.priority + 1); | 477 | pr->public_data.priority + 1); |
477 | else | 478 | else |
@@ -486,7 +487,7 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
486 | gm->query = pr->public_data.query; | 487 | gm->query = pr->public_data.query; |
487 | ext = (GNUNET_HashCode*) &gm[1]; | 488 | ext = (GNUNET_HashCode*) &gm[1]; |
488 | k = 0; | 489 | k = 0; |
489 | if (GNUNET_YES != do_route) | 490 | if (! do_route) |
490 | GNUNET_PEER_resolve (pr->sender_pid, | 491 | GNUNET_PEER_resolve (pr->sender_pid, |
491 | (struct GNUNET_PeerIdentity*) &ext[k++]); | 492 | (struct GNUNET_PeerIdentity*) &ext[k++]); |
492 | if (GNUNET_BLOCK_TYPE_FS_SBLOCK == pr->public_data.type) | 493 | if (GNUNET_BLOCK_TYPE_FS_SBLOCK == pr->public_data.type) |