diff --git a/include/proto/htx.h b/include/proto/htx.h index e59bb4f48..b6f1042f4 100644 --- a/include/proto/htx.h +++ b/include/proto/htx.h @@ -532,9 +532,10 @@ static inline struct htx *htx_from_buf(struct buffer *buf) if (b_is_null(buf)) return &htx_empty; htx = (struct htx *)(buf->area); - htx->size = buf->size - sizeof(*htx); - if (!b_data(buf)) + if (!b_data(buf)) { + htx->size = buf->size - sizeof(*htx); htx_reset(htx); + } return htx; }