diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-06-17 20:28:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-06-17 20:28:00 +0000 |
commit | 135ec26aa7c37786e2dfa1d6dc99f9ea407cdb30 (patch) | |
tree | ebe43de32aa35ee6c4f9a4551fa082c68d9cf599 /src/fs | |
parent | 48331b7ce205002b7dc7e4c1809fd6c1863f758c (diff) | |
download | gnunet-135ec26aa7c37786e2dfa1d6dc99f9ea407cdb30.tar.gz gnunet-135ec26aa7c37786e2dfa1d6dc99f9ea407cdb30.zip |
checks
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 4 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 350ee54f1..56129273c 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -1189,6 +1189,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
1189 | enum GNUNET_BLOCK_Type type; | 1189 | enum GNUNET_BLOCK_Type type; |
1190 | GNUNET_PEER_Id spid; | 1190 | GNUNET_PEER_Id spid; |
1191 | 1191 | ||
1192 | GNUNET_assert (other != NULL); | ||
1192 | msize = ntohs(message->size); | 1193 | msize = ntohs(message->size); |
1193 | if (msize < sizeof (struct GetMessage)) | 1194 | if (msize < sizeof (struct GetMessage)) |
1194 | { | 1195 | { |
@@ -1299,13 +1300,14 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
1299 | spid = 0; | 1300 | spid = 0; |
1300 | if ( (GNUNET_LOAD_get_load (cp->ppd.transmission_delay) > 3 * (1 + priority)) || | 1301 | if ( (GNUNET_LOAD_get_load (cp->ppd.transmission_delay) > 3 * (1 + priority)) || |
1301 | (GNUNET_LOAD_get_average (cp->ppd.transmission_delay) > | 1302 | (GNUNET_LOAD_get_average (cp->ppd.transmission_delay) > |
1302 | GNUNET_CONSTANTS_MAX_CORK_DELAY.rel_value * 2 + GNUNET_LOAD_get_average (GSF_rt_entry_lifetime)) ) | 1303 | GNUNET_CONSTANTS_MAX_CORK_DELAY.rel_value * 2 + GNUNET_LOAD_get_average (GSF_rt_entry_lifetime)) ) |
1303 | { | 1304 | { |
1304 | /* don't have BW to send to peer, or would likely take longer than we have for it, | 1305 | /* don't have BW to send to peer, or would likely take longer than we have for it, |
1305 | so at best indirect the query */ | 1306 | so at best indirect the query */ |
1306 | priority = 0; | 1307 | priority = 0; |
1307 | options |= GSF_PRO_FORWARD_ONLY; | 1308 | options |= GSF_PRO_FORWARD_ONLY; |
1308 | spid = GNUNET_PEER_intern (other); | 1309 | spid = GNUNET_PEER_intern (other); |
1310 | GNUNET_assert (0 != spid); | ||
1309 | } | 1311 | } |
1310 | ttl = bound_ttl (ntohl (gm->ttl), priority); | 1312 | ttl = bound_ttl (ntohl (gm->ttl), priority); |
1311 | /* decrement ttl (always) */ | 1313 | /* decrement ttl (always) */ |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index e17d778db..c43b1be04 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -328,6 +328,8 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
328 | pr->sender_pid = sender_pid; | 328 | pr->sender_pid = sender_pid; |
329 | pr->rh = rh; | 329 | pr->rh = rh; |
330 | pr->rh_cls = rh_cls; | 330 | pr->rh_cls = rh_cls; |
331 | GNUNET_assert ( (sender_pid != 0) || | ||
332 | (0 == (options & GSF_PRO_FORWARD_ONLY)) ); | ||
331 | if (ttl >= 0) | 333 | if (ttl >= 0) |
332 | pr->public_data.ttl = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 334 | pr->public_data.ttl = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
333 | (uint32_t) ttl)); | 335 | (uint32_t) ttl)); |
@@ -503,10 +505,10 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
503 | k = 0; | 505 | k = 0; |
504 | bm = 0; | 506 | bm = 0; |
505 | do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); | 507 | do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); |
506 | if ( (do_route) && (pr->sender_pid == 0)) | 508 | if ( (! do_route) && (pr->sender_pid == 0)) |
507 | { | 509 | { |
508 | GNUNET_break (0); | 510 | GNUNET_break (0); |
509 | do_route = GNUNET_NO; | 511 | do_route = GNUNET_YES; |
510 | } | 512 | } |
511 | if (! do_route) | 513 | if (! do_route) |
512 | { | 514 | { |