From 892f1dbe4fdd6073e0524c74a0caae3cff81181d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 9 Jul 2018 10:55:37 +0200 Subject: [PATCH] MINOR: buffer: rename the "data" field to "area" Since we use "_data" for the amount of data at many places, as opposed to "_space" for the amount of space, let's rename the "data" field to "area" so that we can reuse "data" later for the amount of data in the buffer (currently called "len" despite not being contigous). --- include/common/buf.h | 8 ++++---- src/flt_http_comp.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/common/buf.h b/include/common/buf.h index b223b21fa..e028f90c8 100644 --- a/include/common/buf.h +++ b/include/common/buf.h @@ -32,11 +32,11 @@ /* Structure defining a buffer's head */ struct buffer { - size_t head; /* start offset of remaining data relative to data */ + size_t head; /* start offset of remaining data relative to area */ size_t len; /* length of data after head */ size_t size; /* buffer size in bytes */ size_t output; /* TEMPORARY: part of which is to be forwarded */ - char data[0]; /* bytes of stored data */ + char area[0]; /* bytes of stored data */ }; @@ -53,7 +53,7 @@ struct buffer { */ static inline char *b_orig(const struct buffer *b) { - return (char *)b->data; + return (char *)b->area; } /* b_size() : returns the size of the buffer. */ @@ -67,7 +67,7 @@ static inline size_t b_size(const struct buffer *b) */ static inline char *b_wrap(const struct buffer *b) { - return (char *)b->data + b->size; + return (char *)b->area + b->size; } /* b_data() : returns the number of bytes present in the buffer. */ diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index f8c82c4b7..2c15d795d 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -705,7 +705,7 @@ http_compression_buffer_end(struct comp_state *st, struct stream *s, * data p size * * is the room reserved to copy the channel output. It starts at - * ob->data and has not yet been filled. is the room reserved to + * ob->area and has not yet been filled. is the room reserved to * write the chunk size (10 bytes). is the compressed * equivalent of the data part of ib->len. is the amount of * empty bytes at the end of the buffer, into which we may have to