]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: htx: Remove support for unused OOB HTX blocks
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 May 2019 19:48:12 +0000 (21:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 May 2019 20:16:41 +0000 (22:16 +0200)
This type of block was introduced in the early design of the HTX and it is not
used anymore. So, just remove it.

This patch may be backported to 1.9.

include/common/htx.h
src/htx.c
src/mux_h1.c

index cd7db0526e48120ff023d2be448a10fb1d54e79a..78e62a5008671287e855b26b6a3cbe5d6e0f88ec 100644 (file)
@@ -111,8 +111,7 @@ enum htx_blk_type {
        HTX_BLK_EOD    =  6, /* end-of-data block */
        HTX_BLK_TLR    =  7, /* trailer name/value block */
        HTX_BLK_EOM    =  8, /* end-of-message block */
-       /* 9 .. 13 unused */
-       HTX_BLK_OOB    = 14, /* Out of band block, don't alter the parser */
+       /* 9 .. 14 unused */
        HTX_BLK_UNUSED = 15, /* unused/removed block */
 };
 
@@ -194,7 +193,6 @@ struct htx_blk *htx_add_pseudo_header(struct htx *htx,  enum htx_phdr_type phdr,
 struct htx_blk *htx_add_endof(struct htx *htx, enum htx_blk_type type);
 struct htx_blk *htx_add_data(struct htx *htx, const struct ist data);
 struct htx_blk *htx_add_trailer(struct htx *htx, const struct ist tlr);
-struct htx_blk *htx_add_oob(struct htx *htx, const struct ist oob);
 struct htx_blk *htx_add_data_before(struct htx *htx, const struct htx_blk *ref, const struct ist data);
 
 int htx_reqline_to_h1(const struct htx_sl *sl, struct buffer *chk);
@@ -534,7 +532,6 @@ static inline void htx_set_blk_value_len(struct htx_blk *blk, uint32_t vlen)
                case HTX_BLK_RES_SL:
                case HTX_BLK_DATA:
                case HTX_BLK_TLR:
-               case HTX_BLK_OOB:
                        blk->info = (type << 28) + vlen;
                        break;
                default:
@@ -593,7 +590,6 @@ static inline struct ist htx_get_blk_value(const struct htx *htx, const struct h
                case HTX_BLK_RES_SL:
                case HTX_BLK_DATA:
                case HTX_BLK_TLR:
-               case HTX_BLK_OOB:
                        ret.ptr = htx_get_blk_ptr(htx, blk);
                        ret.len = blk->info & 0xfffffff;
                        break;
@@ -765,7 +761,6 @@ static inline const char *htx_blk_type_str(enum htx_blk_type type)
                case HTX_BLK_EOD:    return "HTX_BLK_EOD";
                case HTX_BLK_TLR:    return "HTX_BLK_TLR";
                case HTX_BLK_EOM:    return "HTX_BLK_EOM";
-               case HTX_BLK_OOB:    return "HTX_BLK_OOB";
                case HTX_BLK_UNUSED: return "HTX_BLK_UNUSED";
                default:             return "HTX_BLK_???";
        };
index 25848d3d354d4dcc455b3a7058c01f22680e0503..525f7ef695868eca3cad4ae40705181672d2dd0e 100644 (file)
--- a/src/htx.c
+++ b/src/htx.c
@@ -802,23 +802,6 @@ struct htx_blk *htx_add_trailer(struct htx *htx, const struct ist tlr)
        return blk;
 }
 
-/* Adds an HTX block of type OOB in <htx>. It returns the new block on
- * success. Otherwise, it returns NULL.
- */
-struct htx_blk *htx_add_oob(struct htx *htx, const struct ist oob)
-{
-       struct htx_blk *blk;
-
-       /* FIXME: check oob.len (< 256MB) */
-       blk = htx_add_blk(htx, HTX_BLK_OOB, oob.len);
-       if (!blk)
-               return NULL;
-
-       blk->info += oob.len;
-       memcpy(htx_get_blk_ptr(htx, blk), oob.ptr, oob.len);
-       return blk;
-}
-
 struct htx_blk *htx_add_data_before(struct htx *htx, const struct htx_blk *ref,
                                    const struct ist data)
 {
index 6c85c11ae875528b84069750ec19b08a065d8852..d91f45d781d7e36f02a2a4c9ebc8b24d14c52b9b 100644 (file)
@@ -1644,12 +1644,6 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun
                                h1m->state = H1_MSG_DONE;
                                break;
 
-                       case HTX_BLK_OOB:
-                               v = htx_get_blk_value(chn_htx, blk);
-                               if (!chunk_memcat(tmp, v.ptr, v.len))
-                                       goto copy;
-                               break;
-
                        default:
                                h1m->flags |= errflag;
                                break;