]> git.ipfire.org Git - fireperf.git/commitdiff
main: Fix fetching the random buffer
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Sep 2024 09:00:41 +0000 (09:00 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Sep 2024 09:00:41 +0000 (09:00 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/main.c

index 35a1f509aef62f8da2e1b10e8d9691eea4493e77..a7468be94120e9bba6064e0da3dd08861d915d81 100644 (file)
@@ -239,8 +239,8 @@ int handle_connection_send(struct fireperf_ctx* ctx,
        const char* buffer = ZERO;
        ssize_t bytes_sent;
 
-       if (ctx->pool) {
-               buffer = fireperf_random_pool_get_slice(ctx->pool, SOCKET_SEND_BUFFER_SIZE);
+       if (!ctx->zero) {
+               buffer = fireperf_random_pool_get_slice(ctx, SOCKET_SEND_BUFFER_SIZE);
        }
 
        do {