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.
This commit is contained in:
Willy Tarreau 2024-02-27 18:54:19 +01:00
parent b30fd8cc2d
commit 7c9ce715c9
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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)