return NULL;
}
gm = (const struct GetMessage*) message;
-#if DEBUG_FS
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received request for `%s' from `%s'\n",
- GNUNET_h2s (&gm->query),
- GNUNET_i2s (other));
-#endif
type = ntohl (gm->type);
bm = ntohl (gm->hash_bitmap);
bits = 0;
{
#if DEBUG_FS && 0
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Migration already blocked for another %llu ms\n",
+ "Migration already blocked for another %llu ms\n",
(unsigned long long) GNUNET_TIME_absolute_get_remaining (cp->last_migration_block).rel_value);
#endif
return; /* already blocked */
prd = GSF_pending_request_get_data_ (rp->pr);
// FIXME: calculate 'rp->earliest_transmission'!
- // fIXME: claculate 'rp->priority'!
+ // FIXME: claculate 'rp->priority'!
+ rp->earliest_transmission
+ = GNUNET_TIME_relative_to_absolute
+ (GNUNET_TIME_relative_multiply
+ (GNUNET_TIME_UNIT_SECONDS,
+ rp->transmission_counter));
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Earliest (re)transmission for `%s' in %us\n",
+ GNUNET_h2s (&prd->query),
+ rp->transmission_counter);
+#endif
+
if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value == 0)
rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap,
struct GSF_PendingRequest *pr;
struct GSF_PendingRequest *dpr;
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Creating request handle for `%s' of type %d\n",
+ GNUNET_h2s (query),
+ type);
+#endif
pr = GNUNET_malloc (sizeof (struct GSF_PendingRequest));
pr->public_data.query = *query;
if (GNUNET_BLOCK_TYPE_FS_SBLOCK == type)
int64_t ttl;
int do_route;
-
+#if DEBUG_FS
+ if (buf_size > 0)
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Building request message for `%s' of type %d\n",
+ GNUNET_h2s (&pr->public_data.query),
+ pr->public_data.type);
+#endif
k = 0;
bm = 0;
do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY));
prq->expiration,
prq->type,
prq->data, prq->size);
+ GSF_pending_request_cancel_ (pr);
return GNUNET_YES;
case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
GNUNET_STATISTICS_update (GSF_stats,