diff --git a/scripts/lightning-client b/scripts/lightning-client index 923210a..61f13c0 100755 --- a/scripts/lightning-client +++ b/scripts/lightning-client @@ -11,5 +11,5 @@ donar \ > $6/log/client-donar-stdout.log 2> $6/log/client-donar-stderr.log & sleep 2 -measlat -h 127.13.3.7 -p 9000 -r > /dev/null 2>&1 # Used to wait for connections +measlat -h 127.13.3.7 -p 9000 -r > $6/log/client-measboot-stdout.log 2> $6/log/client-measboot-stderr.log measlat -h 127.13.3.7 -p 9000 -c $1 -i $2 -s $3 > $6/log/client-measlat-stdout.log 2> $6/log/client-measlat-stderr.log diff --git a/src/meas_lat.c b/src/meas_lat.c index ac8ccda..50a1809 100644 --- a/src/meas_lat.c +++ b/src/meas_lat.c @@ -160,7 +160,10 @@ int on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { struct evt_core_fdinfo* tgtinfo = evt_core_get_first_from_cat (ctx, "udp-read"); if (tgtinfo == NULL) tgtinfo = evt_core_get_first_from_cat (ctx, "tcp-read"); - if (tgtinfo == NULL || mctx->mc.counter > mctx->mc.max_measure) { + if (!mctx->mc.is_server && tgtinfo == NULL) { + fprintf(stderr, "Unable to find a fdinfo in udp-read nor in tcp-read. Quitting...\n"); + exit(EXIT_FAILURE); + } else if (mctx->mc.is_server && (tgtinfo == NULL || mctx->mc.counter > mctx->mc.max_measure)) { printf("No connection yet\n"); struct evt_core_fdinfo* timer_fd = evt_core_get_first_from_cat (ctx, "timer"); evt_core_rm_fd(ctx, timer_fd->fd);