src/rdkafka_broker.c
static void rd_kafka_buf_finalize (rd_kafka_t *rk, rd_kafka_buf_t *rkbuf) {
        size_t totsize;

        /* Calculate total request buffer length. */
        totsize = rd_buf_len(&rkbuf->rkbuf_buf) - 4;
        rd_assert(totsize <= (size_t)rk->rk_conf.max_msg_size);

        /* Set up a buffer reader for sending the buffer. */
        rd_slice_init_full(&rkbuf->rkbuf_reader, &rkbuf->rkbuf_buf);

        /**
         * Update request header fields
         */
        /* Total reuqest length */
        rd_kafka_buf_update_i32(rkbuf, 0, (int32_t)totsize);

        /* ApiVersion */
        rd_kafka_buf_update_i16(rkbuf, 4+2, rkbuf->rkbuf_reqhdr.ApiVersion);
}
/**
 * Finalize a stuffed rkbuf for sending to broker.
 */
Finalize a stuffed rkbuf for sending to broker.
Finalize a stuffed rkbuf for sending to broker .
static void rd_kafka_buf_finalize (rd_kafka_t *rk, rd_kafka_buf_t *rkbuf) {
        size_t totsize;
        totsize = rd_buf_len(&rkbuf->rkbuf_buf) - 4;
        rd_assert(totsize <= (size_t)rk->rk_conf.max_msg_size);
        rd_slice_init_full(&rkbuf->rkbuf_reader, &rkbuf->rkbuf_buf);
        rd_kafka_buf_update_i32(rkbuf, 0, (int32_t)totsize);
        rd_kafka_buf_update_i16(rkbuf, 4+2, rkbuf->rkbuf_reqhdr.ApiVersion);
}
static void rd_kafka_buf_finalize ( rd_kafka_t * rk , rd_kafka_buf_t * rkbuf ) { size_t totsize ; totsize = rd_buf_len ( & rkbuf -> rkbuf_buf ) - 4 ; rd_assert ( totsize <= ( size_t ) rk -> rk_conf . max_msg_size ) ; rd_slice_init_full ( & rkbuf -> rkbuf_reader , & rkbuf -> rkbuf_buf ) ; rd_kafka_buf_update_i32 ( rkbuf , 0 , ( int32_t ) totsize ) ; rd_kafka_buf_update_i16 ( rkbuf , 4 + 2 , rkbuf -> rkbuf_reqhdr . ApiVersion ) ; }
Finalize a stuffed rkbuf for sending to broker.
Finalize a stuffed rkbuf for sending to broker .
/* Calculate total request buffer length. */ /* Set up a buffer reader for sending the buffer. */ /**
         * Update request header fields
         */ /* Total reuqest length */ /* ApiVersion */