mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 14:50:59 +01:00
DOC: htx: make it clear that htxbuf() and htx_from_buf() always return valid pointers
Update the comments above htxbuf() and htx_from_buf() to make it clear that they always return valid htx pointers so that callers know they do not have to test them. This is only true after the fix on b_is_null() which was the only known corner case. This should be backported to 1.9 if the b_is_null() patch is backported.
This commit is contained in:
parent
203d735cac
commit
245d189cce
@ -690,7 +690,10 @@ static inline size_t buf_room_for_htx_data(const struct buffer *buf)
|
|||||||
|
|
||||||
|
|
||||||
/* Returns an HTX message using the buffer <buf>. Unlike htx_from_buf(), this
|
/* Returns an HTX message using the buffer <buf>. Unlike htx_from_buf(), this
|
||||||
* function does not update to the buffer. */
|
* function does not update to the buffer.
|
||||||
|
* Note that it always returns a valid pointer, either to an initialized buffer
|
||||||
|
* or to the empty buffer.
|
||||||
|
*/
|
||||||
static inline struct htx *htxbuf(const struct buffer *buf)
|
static inline struct htx *htxbuf(const struct buffer *buf)
|
||||||
{
|
{
|
||||||
struct htx *htx;
|
struct htx *htx;
|
||||||
@ -707,10 +710,10 @@ static inline struct htx *htxbuf(const struct buffer *buf)
|
|||||||
|
|
||||||
/* Returns an HTX message using the buffer <buf>. <buf> is updated to appear as
|
/* Returns an HTX message using the buffer <buf>. <buf> is updated to appear as
|
||||||
* full. It is the caller responsibility to call htx_to_buf() when it finish to
|
* full. It is the caller responsibility to call htx_to_buf() when it finish to
|
||||||
* manipulate the HTX message to update <buf> accordingly.
|
* manipulate the HTX message to update <buf> accordingly. The returned pointer
|
||||||
|
* is always valid.
|
||||||
*
|
*
|
||||||
* If the caller can call htxbuf() function to avoir any update of the
|
* The caller can call htxbuf() function to avoid any update of the buffer.
|
||||||
* buffer.
|
|
||||||
*/
|
*/
|
||||||
static inline struct htx *htx_from_buf(struct buffer *buf)
|
static inline struct htx *htx_from_buf(struct buffer *buf)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user