From 1e58805b549431744385a98aef5d6c78aad3077c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 26 Jan 2021 16:35:36 +0100 Subject: [PATCH] Output data only if client --- src/meas_lat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meas_lat.c b/src/meas_lat.c index 6d936e0..d860ac8 100644 --- a/src/meas_lat.c +++ b/src/meas_lat.c @@ -90,7 +90,7 @@ int on_receive_measure_packet_err(struct evt_core_ctx* ctx, struct evt_core_fdin sprintf(url, "timer:%d", fdinfo->fd); struct evt_core_fdinfo* assoc_timer = evt_core_get_from_url (ctx, url); if (assoc_timer != NULL) { - measure_summary (&mctx->mp, assoc_timer->other); + if (mctx->role == MEASLAT_CLIENT) measure_summary (&mctx->mp, assoc_timer->other); evt_core_rm_fd (ctx, assoc_timer->fd); printf("Deleted associated timer %s\n", url); } else { @@ -111,7 +111,7 @@ void measlat_stop( if (ms->mp_in->counter < mctx->mp.max_measure) return; if (ms->mp_out->counter < mctx->mp.max_measure) return; printf("[states] measurement %d+%d terminated\n", net_fd, timer_fd); - measure_summary (&(mctx->mp), ms); + if (mctx->role == MEASLAT_CLIENT) measure_summary (&(mctx->mp), ms); evt_core_rm_fd(ctx, timer_fd); if (!(mctx->connectionless && mctx->role == MEASLAT_SERVER)) evt_core_rm_fd(ctx, net_fd);