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.
This commit is contained in:
parent
6177509eb7
commit
6f3cb1801b
|
@ -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_???";
|
||||
};
|
||||
|
|
17
src/htx.c
17
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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue