]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ring: make callers use ring_data() and ring_size(), not ring->buf
authorWilly Tarreau <w@1wt.eu>
Tue, 27 Feb 2024 17:54:19 +0000 (18:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
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
src/mworker.c

index 7a2d14a153e4d6766982ef88f79c614b19670a75..c851de31e1658a62118871cd807afb79185d3925 100644 (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;
 }
index c71446ab8bf802ee5544ea36c4c98e2d6b741e82..07d5a99b53a33c2c1ea448a4dc26e9a4fd8d48b2 100644 (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)