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).
This commit is contained in:
Willy Tarreau 2018-07-09 10:55:37 +02:00
parent f6dfd88a92
commit 892f1dbe4f
2 changed files with 5 additions and 5 deletions

View File

@ -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 <len> which is to be forwarded */
char data[0]; /* <size> bytes of stored data */
char area[0]; /* <size> 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. */

View File

@ -705,7 +705,7 @@ http_compression_buffer_end(struct comp_state *st, struct stream *s,
* data p size
*
* <out> is the room reserved to copy the channel output. It starts at
* ob->data and has not yet been filled. <c> is the room reserved to
* ob->area and has not yet been filled. <c> is the room reserved to
* write the chunk size (10 bytes). <comp_in> is the compressed
* equivalent of the data part of ib->len. <empty> is the amount of
* empty bytes at the end of the buffer, into which we may have to