17#ifdef HAS_PROTO_MESSAGE_DUMP
19 auto *proto_msg =
static_cast<const ProtoMessage *
>(msg);
25 const uint8_t footer_size = conn->
helper_->frame_footer_size();
32 to_add = calculated_size;
39 uint16_t total_calculated_size = calculated_size + conn->
batch_header_size_ + footer_size;
40 if (total_calculated_size > remaining_size)
44 if (!shared_buf.resize(shared_buf.size() + to_add)) [[unlikely]] {
45 conn->fatal_out_of_memory_();
49 encode_fn(msg, buffer PROTO_ENCODE_DEBUG_INIT(&shared_buf));
51 return total_calculated_size;