From 7c9ce715c946d9da8f53c22dc00b3555966ce036 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 27 Feb 2024 18:54:19 +0100 Subject: [PATCH] MINOR: ring: make callers use ring_data() and ring_size(), not ring->buf As we're going to remove the ring's buffer, we don't want callers to access it directly, so let's use ring_data() and ring_size() instead for this. --- src/errors.c | 4 ++-- src/mworker.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/errors.c b/src/errors.c index 7a2d14a153..c851de31e1 100644 --- a/src/errors.c +++ b/src/errors.c @@ -206,12 +206,12 @@ struct ring *startup_logs_dup(struct ring *src) struct ring *dst = NULL; /* must use the size of the previous buffer */ - dst = ring_new(b_size(&src->buf)); + dst = ring_new(ring_size(src)); if (!dst) goto error; b_reset(&dst->buf); - b_ncat(&dst->buf, &src->buf, b_data(&src->buf)); + b_ncat(&dst->buf, &src->buf, ring_data(src)); error: return dst; } diff --git a/src/mworker.c b/src/mworker.c index c71446ab8b..07d5a99b53 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -738,7 +738,7 @@ static int cli_io_handler_show_loadstatus(struct appctx *appctx) chunk_printf(&trash, "Success=1\n"); } #ifdef USE_SHM_OPEN - if (startup_logs && b_data(&startup_logs->buf) > 1) + if (startup_logs && ring_data(startup_logs) > 1) chunk_appendf(&trash, "--\n"); if (applet_putchk(appctx, &trash) == -1) -- 2.39.5