{
struct GNUNET_DEFRAGMENT_Context *dc;
- dc = GNUNET_malloc (sizeof (struct GNUNET_DEFRAGMENT_Context));
+ dc = GNUNET_new (struct GNUNET_DEFRAGMENT_Context);
dc->stats = stats;
dc->cls = cls;
dc->proc = proc;
for (mc = dc->head; NULL != mc; mc = mc->next)
if (mc->fragment_id > fid)
last++;
-
+
mc = dc->head;
while ((NULL != mc) && (fid != mc->fragment_id))
mc = mc->next;
}
/* send ACK */
if (mc->frag_times_write_offset - mc->frag_times_start_offset > 1)
- {
+ {
dc->latency = estimate_latency (mc);
}
delay = GNUNET_TIME_relative_multiply (dc->latency, bc + 1);
if ( (last + fid == num_fragments) ||
- (0 == mc->bits) ||
- (GNUNET_YES == duplicate))
+ (0 == mc->bits) ||
+ (GNUNET_YES == duplicate))
{
/* message complete or duplicate or last missing fragment in
linear sequence; ACK now! */