MINOR: htx: make htx_from_buf() adjust the size only on new buffers
This one is used a lot during transfers, let's avoid resetting its
size when there are already data in the buffer since it implies the
size is correct.
diff --git a/include/proto/htx.h b/include/proto/htx.h
index e59bb4f..b6f1042 100644
--- a/include/proto/htx.h
+++ b/include/proto/htx.h
@@ -532,9 +532,10 @@
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;
}