break;
if (type == HTX_BLK_HDR) {
- if (!sl) {
- TRACE_ERROR("no start-line", H2_EV_TX_FRAME|H2_EV_TX_HDR|H2_EV_H2S_ERR, h2c->conn, h2s);
- goto fail;
- }
+ BUG_ON(!sl); /* The start-line mut be defined before any headers */
if (unlikely(hdr >= sizeof(list)/sizeof(list[0]) - 1)) {
TRACE_ERROR("too many headers", H2_EV_TX_FRAME|H2_EV_TX_HDR|H2_EV_H2S_ERR, h2c->conn, h2s);
goto fail;
hdr++;
}
else if (type == HTX_BLK_RES_SL) {
- if (sl) {
- TRACE_PROTO("multiple start-lines", H2_EV_TX_FRAME|H2_EV_TX_HDR|H2_EV_H2S_ERR, h2c->conn, h2s);
- goto fail;
- }
+ BUG_ON(sl); /* Only one start-line expected */
sl = htx_get_blk_ptr(htx, blk);
h2s->status = sl->info.res.status;
if (h2s->status == 204 || h2s->status == 304)
}
}
+ /* The start-line me be defined */
+ BUG_ON(!sl);
+
/* marker for end of headers */
list[hdr].n = ist("");
break;
if (type == HTX_BLK_REQ_SL) {
- if (sl) {
- TRACE_ERROR("multiple start-lines", H2_EV_TX_FRAME|H2_EV_TX_HDR|H2_EV_H2S_ERR, h2c->conn, h2s);
- goto fail;
- }
+ BUG_ON(sl); /* Only one start-line expected */
sl = htx_get_blk_ptr(htx, blk);
meth = htx_sl_req_meth(sl);
uri = htx_sl_req_uri(sl);
}
}
else if (type == HTX_BLK_HDR) {
- if (!sl) {
- TRACE_ERROR("no start-line", H2_EV_TX_FRAME|H2_EV_TX_HDR|H2_EV_H2S_ERR, h2c->conn, h2s);
- goto fail;
- }
+ BUG_ON(!sl); /* The start-line mut be defined before any headers */
if (unlikely(hdr >= sizeof(list)/sizeof(list[0]) - 1)) {
TRACE_ERROR("too many headers", H2_EV_TX_FRAME|H2_EV_TX_HDR|H2_EV_H2S_ERR, h2c->conn, h2s);
goto fail;
}
}
+ /* The start-line me be defined */
+ BUG_ON(!sl);
+
/* Now add the server name to a header (if requested) */
if ((h2c->flags & H2_CF_IS_BACK) && h2c->proxy->server_id_hdr_name) {
struct server *srv = objt_server(h2c->conn->target);