diff --git a/src/core/ddsi/src/q_config.c b/src/core/ddsi/src/q_config.c index e318181..de2cceb 100644 --- a/src/core/ddsi/src/q_config.c +++ b/src/core/ddsi/src/q_config.c @@ -654,7 +654,7 @@ END_MARKER static const struct cfgelem sizing_cfgelems[] = { { LEAF("ReceiveBufferSize"), 1, "1 MiB", ABSOFF(rbuf_size), 0, uf_memsize, 0, pf_memsize, - "
This element sets the size of a single receive buffer. Many receive buffers may be needed. Their size must be greater than ReceiveBufferChunkSize by a modest amount.
" }, + "This element sets the size of a single receive buffer. Many receive buffers may be needed. The minimum workable size a little bit larger than Sizing/ReceiveBufferChunkSize, and the value used is taken as the configured value and the actual minimum workable size.
" }, { LEAF("ReceiveBufferChunkSize"), 1, "128 KiB", ABSOFF(rmsg_chunk_size), 0, uf_memsize, 0, pf_memsize, "This element specifies the size of one allocation unit in the receive buffer. Must be greater than the maximum packet size by a modest amount (too large packets are dropped). Each allocation is shrunk immediately after processing a message, or freed straightaway.
" }, END_MARKER diff --git a/src/core/ddsi/src/q_radmin.c b/src/core/ddsi/src/q_radmin.c index c6f4a22..41c6192 100644 --- a/src/core/ddsi/src/q_radmin.c +++ b/src/core/ddsi/src/q_radmin.c @@ -330,7 +330,13 @@ struct nn_rbufpool *nn_rbufpool_new (uint32_t rbuf_size, uint32_t max_rmsg_size) struct nn_rbufpool *rbp; assert (max_rmsg_size > 0); - assert (rbuf_size >= max_rmsg_size_w_hdr (max_rmsg_size)); + + /* raise rbuf_size to minimum possible considering max_rmsg_size, there is + no reason to bother the user with the small difference between the two + when he tries to configure things, and the crash is horrible when + rbuf_size is too small */ + if (rbuf_size < max_rmsg_size_w_hdr (max_rmsg_size)) + rbuf_size = max_rmsg_size_w_hdr (max_rmsg_size); if ((rbp = ddsrt_malloc (sizeof (*rbp))) == NULL) goto fail_rbp;