Fix a second bug

This commit is contained in:
Quentin 2021-01-13 17:39:17 +01:00
parent 08f1632951
commit b4cdf34011

View file

@ -101,8 +101,8 @@ void measlat_stop(
printf("All measurements done\n");
evt_core_rm_fd(ctx, timer_fd);
evt_core_rm_fd(ctx, net_fd);
if (mctx->role == MEASLAT_CLIENT) {
evt_core_rm_fd(ctx, net_fd);
exit(EXIT_SUCCESS);
}
}
@ -156,8 +156,10 @@ int on_receive_measure_packet(struct evt_core_ctx* ctx, struct evt_core_fdinfo*
}
// 5. Check if our measurements are done
if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure)
if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure) {
measlat_stop(ctx, mctx, ms, fdinfo->fd, assoc_timer->fd);
return 1;
}
return 0;
}
@ -222,8 +224,10 @@ int on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) {
exit(EXIT_FAILURE);
}
if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure)
if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure) {
measlat_stop(ctx, mctx, ms, ms->fd, fdinfo->fd);
return 1;
}
return 0;
}