diff --git a/include/common/buf.h b/include/common/buf.h index e028f90c8..c38d65d85 100644 --- a/include/common/buf.h +++ b/include/common/buf.h @@ -35,7 +35,6 @@ struct buffer { 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 area[0]; /* bytes of stored data */ }; @@ -367,7 +366,6 @@ static inline void b_reset(struct buffer *b) { b->head = 0; b->len = 0; - b->output = 0; } /* b_sub() : decreases the buffer length by */ diff --git a/include/common/buffer.h b/include/common/buffer.h index fde7b03f2..018b19ec3 100644 --- a/include/common/buffer.h +++ b/include/common/buffer.h @@ -135,7 +135,6 @@ static inline void bo_putchr(struct buffer *b, char c) return; *b_tail(b) = c; b->len++; - b->output++; } /* Tries to append block at the end of buffer . Supports wrapping. @@ -161,7 +160,6 @@ static inline unsigned int bo_putblk(struct buffer *b, const char *blk, unsigned memcpy(b_tail(b), blk + half, len - half); b->len += len - half; } - b->output += len; return len; } @@ -470,7 +468,6 @@ static inline int bo_istput(struct buffer *b, const struct ist ist) p = b_tail(b); b->len += r.len; - b->output += r.len; while (r.len--) { *p++ = *r.ptr++; if (unlikely(p == end)) diff --git a/include/proto/channel.h b/include/proto/channel.h index 624123799..b2efae843 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -128,7 +128,7 @@ static inline size_t c_full(const struct channel *c) /* co_data() : returns the amount of output data in the channel's buffer */ static inline size_t co_data(const struct channel *c) { - return c->buf->output; + return c->output; } /* ci_data() : returns the amount of input data in the channel's buffer */ @@ -170,7 +170,7 @@ static inline char *c_ptr(const struct channel *c, ssize_t ofs) */ static inline void c_adv(struct channel *c, size_t adv) { - c->buf->output += adv; + c->output += adv; } /* c_rew() : rewinds the channel's buffer by bytes, which means that the @@ -180,7 +180,7 @@ static inline void c_adv(struct channel *c, size_t adv) */ static inline void c_rew(struct channel *c, size_t adv) { - c->buf->output -= adv; + c->output -= adv; } /* c_realign_if_empty() : realign the channel's buffer if it's empty */ @@ -192,8 +192,8 @@ static inline void c_realign_if_empty(struct channel *chn) /* Sets the amount of output for the channel */ static inline void co_set_data(struct channel *c, size_t output) { - c->buf->len += output - c->buf->output; - c->buf->output = output; + c->buf->len += output - c->output; + c->output = output; } @@ -324,6 +324,7 @@ static inline void channel_init(struct channel *chn) chn->pipe = NULL; chn->analysers = 0; chn->flags = 0; + chn->output = 0; } /* Schedule up to more bytes to be forwarded via the channel without @@ -767,7 +768,7 @@ static inline void channel_slow_realign(struct channel *chn, char *swap) static inline void co_skip(struct channel *chn, int len) { b_del(chn->buf, len); - chn->buf->output -= len; + chn->output -= len; c_realign_if_empty(chn); /* notify that some data was written to the SI from the buffer */ diff --git a/include/types/channel.h b/include/types/channel.h index c483399fa..5205bd6f7 100644 --- a/include/types/channel.h +++ b/include/types/channel.h @@ -189,6 +189,7 @@ struct channel { unsigned int analysers; /* bit field indicating what to do on the channel */ struct buffer *buf; /* buffer attached to the channel, always present but may move */ struct pipe *pipe; /* non-NULL only when data present */ + size_t output; /* part of buffer which is to be forwarded */ unsigned int to_forward; /* number of bytes to forward after out without a wake-up */ unsigned short last_read; /* 16 lower bits of last read date (max pause=65s) */ unsigned char xfer_large; /* number of consecutive large xfers */ diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index 2c15d795d..f54feb2b6 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -784,8 +784,8 @@ http_compression_buffer_end(struct comp_state *st, struct stream *s, /* swap the buffers */ *out = chn->buf; chn->buf = ob; - tmp_out = chn->buf->output; - chn->buf->output = *buf_out; + tmp_out = chn->output; + chn->output = *buf_out; *buf_out = tmp_out;