From 6f3cb1801ba8be6d724221ed7217aaff3b91e1a8 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 7 May 2019 21:48:12 +0200 Subject: [PATCH] MINOR: htx: Remove support for unused OOB HTX blocks 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 | 7 +------ src/htx.c | 17 ----------------- src/mux_h1.c | 6 ------ 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/include/common/htx.h b/include/common/htx.h index cd7db0526..78e62a500 100644 --- a/include/common/htx.h +++ b/include/common/htx.h @@ -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_???"; }; diff --git a/src/htx.c b/src/htx.c index 25848d3d3..525f7ef69 100644 --- 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 . 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) { diff --git a/src/mux_h1.c b/src/mux_h1.c index 6c85c11ae..d91f45d78 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -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;