{
if (GNUNET_BLOCK_EVALUATION_OK_LAST == result)
return; /* we're done... */
- GSF_iterate_connected_peers_ (&consider_request_for_forwarding, pr);
+ GSF_iterate_connected_peers_ (&consider_request_for_forwarding,
+ pr);
}
{
struct GSF_PendingRequest *pr;
- pr = GSF_handle_p2p_query_ (other, message);
+ pr = GSF_handle_p2p_query_ (other,
+ message);
if (NULL == pr)
- return GNUNET_SYSERR;
+ return GNUNET_OK; /* exists, identical to existing request, or malformed */
GSF_pending_request_get_data_ (pr)->has_started = GNUNET_YES;
GSF_local_lookup_ (pr,
- &consider_forwarding, NULL);
+ &consider_forwarding,
+ NULL);
return GNUNET_OK;
}
*
* @param ttl_in requested ttl
* @param prio given priority
- * @return ttl_in if ttl_in is below the limit,
- * otherwise the ttl-limit for the given priority
+ * @return @a ttl_in if @a ttl_in is below the limit,
+ * otherwise the ttl-limit for the given @a prio
*/
static int32_t
-bound_ttl (int32_t ttl_in, uint32_t prio)
+bound_ttl (int32_t ttl_in,
+ uint32_t prio)
{
unsigned long long allowed;
}
-
/**
* Handle P2P "QUERY" message. Creates the pending request entry
* and sets up all of the data structures to that we will
{
struct GSF_PendingRequest *ret;
struct GSF_PendingRequestPlanBijection *bi;
+ const struct GSF_PendingRequestData *rprd;
+ const struct GSF_PendingRequestData *prd;
bi = rp->pe_head;
if (NULL == bi)
return NULL; /* should never happen */
ret = bi->pr;
- bi = bi->next_PE;
- while (NULL != bi)
+ rprd = GSF_pending_request_get_data_ (ret);
+ for (bi = bi->next_PE; NULL != bi; bi = bi->next_PE)
{
- if (GSF_pending_request_get_data_ (bi->pr)->ttl.abs_value_us >
- GSF_pending_request_get_data_ (ret)->ttl.abs_value_us)
+ prd = GSF_pending_request_get_data_ (bi->pr);
+ if (prd->ttl.abs_value_us >
+ rprd->ttl.abs_value_us)
+ {
ret = bi->pr;
- bi = bi->next_PE;
+ rprd = prd;
+ }
}
return ret;
}
const struct GNUNET_HashCode *query,
const struct GNUNET_PeerIdentity *target,
const char *bf_data, size_t bf_size,
- uint32_t mingle, uint32_t anonymity_level,
- uint32_t priority, int32_t ttl,
+ uint32_t mingle,
+ uint32_t anonymity_level,
+ uint32_t priority,
+ int32_t ttl,
GNUNET_PEER_Id sender_pid,
GNUNET_PEER_Id origin_pid,
const struct GNUNET_HashCode *replies_seen,
unsigned int replies_seen_count,
- GSF_PendingRequestReplyHandler rh, void *rh_cls)
+ GSF_PendingRequestReplyHandler rh,
+ void *rh_cls)
{
struct GSF_PendingRequest *pr;
struct GSF_PendingRequest *dpr;
pr->replies_seen_size = replies_seen_count;
pr->replies_seen =
GNUNET_malloc (sizeof (struct GNUNET_HashCode) * pr->replies_seen_size);
- memcpy (pr->replies_seen, replies_seen,
+ memcpy (pr->replies_seen,
+ replies_seen,
replies_seen_count * sizeof (struct GNUNET_HashCode));
pr->replies_seen_count = replies_seen_count;
}
if (NULL != bf_data)
{
pr->bf =
- GNUNET_CONTAINER_bloomfilter_init (bf_data, bf_size,
+ GNUNET_CONTAINER_bloomfilter_init (bf_data,
+ bf_size,
GNUNET_CONSTANTS_BLOOMFILTER_K);
pr->mingle = mingle;
}
refresh_bloomfilter (pr);
}
GNUNET_CONTAINER_multihashmap_put (pr_map,
- &pr->public_data.query, pr,
+ &pr->public_data.query,
+ pr,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES))
{
pr->hnode =
- GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr,
+ GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap,
+ pr,
pr->public_data.ttl.abs_value_us);
/* make sure we don't track too many requests */
while (GNUNET_CONTAINER_heap_get_size (requests_by_expiration_heap) >
max_pending_requests)
{
dpr = GNUNET_CONTAINER_heap_peek (requests_by_expiration_heap);
- GNUNET_assert (dpr != NULL);
+ GNUNET_assert (NULL != dpr);
if (pr == dpr)
break; /* let the request live briefly... */
if (NULL != dpr->rh)
- dpr->rh (dpr->rh_cls, GNUNET_BLOCK_EVALUATION_REQUEST_VALID, dpr,
- UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_ABS,
+ dpr->rh (dpr->rh_cls,
+ GNUNET_BLOCK_EVALUATION_REQUEST_VALID,
+ dpr,
+ UINT32_MAX,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
GNUNET_BLOCK_TYPE_ANY, NULL, 0);
- GSF_pending_request_cancel_ (dpr, GNUNET_YES);
+ GSF_pending_request_cancel_ (dpr,
+ GNUNET_YES);
}
}
GNUNET_STATISTICS_update (GSF_stats,