From: Baptiste Assmann Date: Sat, 18 Apr 2020 12:50:11 +0000 (+0200) Subject: MINOR: istbuf: add ist2buf() function X-Git-Tag: v2.2-dev7~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e9d87bf0676a0813cef6cb0c85e74e5707cff7d;p=thirdparty%2Fhaproxy.git MINOR: istbuf: add ist2buf() function Purpose of this function is to build a from a . --- diff --git a/include/common/istbuf.h b/include/common/istbuf.h index 9b6ce7c6bd..a533c71749 100644 --- a/include/common/istbuf.h +++ b/include/common/istbuf.h @@ -139,6 +139,19 @@ static inline size_t b_putist(struct buffer *b, const struct ist ist) return b_putblk(b, ist.ptr, ist.len); } +/* builds and return a based on + */ +static inline struct buffer ist2buf(const struct ist ist) +{ + struct buffer buf; + + buf.area = ist.ptr; + buf.size = ist.len; + buf.data = ist.len; + buf.head = 0; + return buf; +} + #endif /* _COMMON_ISTBUF_H */ /*