GSF_LocalLookupContinuation llc_cont;
/**
- * Closure for llc_cont.
+ * Closure for @e llc_cont.
*/
void *llc_cont_cls;
struct GNUNET_PeerIdentity origin;
/**
- * GNUNET_YES if we had a matching request for this block,
- * GNUNET_NO if not.
+ * #GNUNET_YES if we had a matching request for this block,
+ * #GNUNET_NO if not.
*/
int requested;
};
ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Replicated content already exists locally, asking to stop migration for %s\n",
- GNUNET_STRINGS_relative_time_to_string (mig_pause, GNUNET_YES));
- GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause));
+ GNUNET_STRINGS_relative_time_to_string (mig_pause,
+ GNUNET_YES));
+ GSF_block_peer_migration_ (cp,
+ GNUNET_TIME_relative_to_absolute (mig_pause));
}
}
GNUNET_free (pmc);
* @param data pointer to the result data
*/
static void
-handle_dht_reply (void *cls, struct GNUNET_TIME_Absolute exp,
- const struct GNUNET_HashCode * key,
+handle_dht_reply (void *cls,
+ struct GNUNET_TIME_Absolute exp,
+ const struct GNUNET_HashCode *key,
const struct GNUNET_PeerIdentity *get_path,
unsigned int get_path_length,
const struct GNUNET_PeerIdentity *put_path,
- unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
- size_t size, const void *data)
+ unsigned int put_path_length,
+ enum GNUNET_BLOCK_Type type,
+ size_t size,
+ const void *data)
{
struct GSF_PendingRequest *pr = cls;
struct ProcessReplyClosure prq;
GNUNET_CONSTANTS_SERVICE_TIMEOUT,
&put_migration_continuation, pmc))
{
- put_migration_continuation (pmc, GNUNET_SYSERR, GNUNET_TIME_UNIT_ZERO_ABS, NULL);
+ put_migration_continuation (pmc,
+ GNUNET_SYSERR,
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ NULL);
}
}
}
if (NULL == (cont = pr->llc_cont))
return; /* no continuation */
pr->llc_cont = NULL;
+ if (0 != (GSF_PRO_LOCAL_ONLY & pr->public_data.options))
+ {
+ if (GNUNET_BLOCK_EVALUATION_OK_LAST != pr->local_result)
+ {
+ /* Signal that we are done and that there won't be any
+ additional results to allow client to clean up state. */
+ pr->rh (pr->rh_cls,
+ GNUNET_BLOCK_EVALUATION_OK_LAST,
+ pr,
+ UINT32_MAX,
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ GNUNET_BLOCK_TYPE_ANY,
+ NULL, 0);
+ }
+ /* Finally, call our continuation to signal that we are
+ done with local processing of this request; i.e. to
+ start reading again from the client. */
+ cont (pr->llc_cont_cls, NULL, GNUNET_BLOCK_EVALUATION_OK_LAST);
+ return;
+ }
+
cont (pr->llc_cont_cls, pr, pr->local_result);
}
* @param cp the other peer involved (sender or receiver, NULL
* for loopback messages where we are both sender and receiver)
* @param message the actual message
- * @return GNUNET_OK if the message was well-formed,
- * GNUNET_SYSERR if the message was malformed (close connection,
+ * @return #GNUNET_OK if the message was well-formed,
+ * #GNUNET_SYSERR if the message was malformed (close connection,
* do not cache under any circumstances)
*/
int
/* do not allow migrated content to live longer than 1 year */
expiration = GNUNET_TIME_absolute_min (GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS),
expiration);
- if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND)
+ if (GNUNET_BLOCK_TYPE_FS_ONDEMAND == type)
return GNUNET_SYSERR;
if (GNUNET_OK !=
- GNUNET_BLOCK_get_key (GSF_block_ctx, type, &put[1], dsize, &query))
+ GNUNET_BLOCK_get_key (GSF_block_ctx,
+ type,
+ &put[1],
+ dsize,
+ &query))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
prq.priority = 0;
prq.anonymity_level = UINT32_MAX;
prq.request_found = GNUNET_NO;
- GNUNET_CONTAINER_multihashmap_get_multiple (pr_map, &query, &process_reply,
+ GNUNET_CONTAINER_multihashmap_get_multiple (pr_map,
+ &query,
+ &process_reply,
&prq);
if (NULL != cp)
{
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Replicating result for query `%s' with priority %u\n",
- GNUNET_h2s (&query), prq.priority);
+ GNUNET_h2s (&query),
+ prq.priority);
pmc = GNUNET_new (struct PutMigrationContext);
pmc->start = GNUNET_TIME_absolute_get ();
pmc->requested = prq.request_found;
GNUNET_CONSTANTS_SERVICE_TIMEOUT,
&put_migration_continuation, pmc))
{
- put_migration_continuation (pmc, GNUNET_SYSERR, GNUNET_TIME_UNIT_ZERO_ABS, NULL);
+ put_migration_continuation (pmc,
+ GNUNET_SYSERR,
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ NULL);
}
}
else if (NULL != cp)