memcpy (ctx->history_by_value, ctx->history_by_time,
sizeof (ctx->history_by_time));
+ /* Remove impossible values */
+ for (i = 0; i < ctx->history_size; i++)
+ if (ctx->history_by_value[i]<0)
+ ctx->history_by_value[i]=NAN;
+
/* Sort all RTTs. */
qsort (ctx->history_by_value, ctx->history_size, sizeof
(ctx->history_by_value[0]), compare_double);
index = (history_offset + x) % ctx->history_size;
latency = ctx->history_by_time[index];
+ if (latency < 0) {
+ continue;
+ }
+
if (latency >= 0.0)
{
double ratio;