"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/common/htx.h" between
haproxy-1.9.3.tar.gz and haproxy-1.9.4.tar.gz

About: HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.

htx.h  (haproxy-1.9.3):htx.h  (haproxy-1.9.4)
skipping to change at line 688 skipping to change at line 688
room = b_room(buf); room = b_room(buf);
if (room <= sizeof(struct htx) + 2 * sizeof(struct htx_blk)) if (room <= sizeof(struct htx) + 2 * sizeof(struct htx_blk))
room = 0; room = 0;
else else
room -= sizeof(struct htx) + 2 * sizeof(struct htx_blk); room -= sizeof(struct htx) + 2 * sizeof(struct htx_blk);
return room; return room;
} }
/* 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;
if (b_is_null(buf)) if (b_is_null(buf))
return &htx_empty; return &htx_empty;
htx = ((struct htx *)(buf->area)); htx = ((struct htx *)(buf->area));
if (!b_data(buf)) { if (!b_data(buf)) {
htx->size = buf->size - sizeof(*htx); htx->size = buf->size - sizeof(*htx);
htx_reset(htx); htx_reset(htx);
} }
return htx; return htx;
} }
/* 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)
{ {
struct htx *htx = htxbuf(buf); struct htx *htx = htxbuf(buf);
b_set_data(buf, b_size(buf)); b_set_data(buf, b_size(buf));
return htx; return htx;
} }
/* Upate <buf> accordingly to the HTX message <htx> */ /* Upate <buf> accordingly to the HTX message <htx> */
static inline void htx_to_buf(struct htx *htx, struct buffer *buf) static inline void htx_to_buf(struct htx *htx, struct buffer *buf)
{ {
if (!htx->used) { if (!htx->used) {
htx_reset(htx); htx_reset(htx);
b_set_data(buf, 0); b_set_data(buf, 0);
} }
else else
b_set_data(buf, b_size(buf)); b_set_data(buf, b_size(buf));
} }
/* Returns 1 if the message is empty, otherwise it returns 0. */ /* Returns 1 if the message is empty, otherwise it returns 0. Note that it is
* illegal to call this with htx == NULL.
*/
static inline int htx_is_empty(const struct htx *htx) static inline int htx_is_empty(const struct htx *htx)
{ {
return (!htx || !htx->used); return !htx->used;
} }
/* Returns 1 if the message is not empty, otherwise it returns 0. */ /* Returns 1 if the message is not empty, otherwise it returns 0. Note that it
* is illegal to call this with htx == NULL.
*/
static inline int htx_is_not_empty(const struct htx *htx) static inline int htx_is_not_empty(const struct htx *htx)
{ {
return (htx && htx->used); return htx->used;
} }
/* For debugging purpose */ /* For debugging purpose */
static inline const char *htx_blk_type_str(enum htx_blk_type type) static inline const char *htx_blk_type_str(enum htx_blk_type type)
{ {
switch (type) { switch (type) {
case HTX_BLK_REQ_SL: return "HTX_BLK_REQ_SL"; case HTX_BLK_REQ_SL: return "HTX_BLK_REQ_SL";
case HTX_BLK_RES_SL: return "HTX_BLK_RES_SL"; case HTX_BLK_RES_SL: return "HTX_BLK_RES_SL";
case HTX_BLK_HDR: return "HTX_BLK_HDR"; case HTX_BLK_HDR: return "HTX_BLK_HDR";
case HTX_BLK_PHDR: return "HTX_BLK_PHDR"; case HTX_BLK_PHDR: return "HTX_BLK_PHDR";
 End of changes. 7 change blocks. 
8 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)