From: Willy Tarreau Date: Tue, 27 Feb 2024 17:54:19 +0000 (+0100) Subject: MINOR: ring: make callers use ring_data() and ring_size(), not ring->buf X-Git-Tag: v3.0-dev6~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c9ce715c9;p=thirdparty%2Fhaproxy.git 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. --- 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)