#define H1S_F_NOT_FIRST 0x00000080 /* The H1 stream is not the first one */
#define H1S_F_BODYLESS_RESP 0x00000100 /* Bodyless response message */
-/* 0x00000200 unused */
+#define H1S_F_INTERNAL_ERROR 0x00000200 /* Set when an internal error occurred during the message parsing */
#define H1S_F_NOT_IMPL_ERROR 0x00000400 /* Set when a feature is not implemented during the message parsing */
#define H1S_F_PARSING_ERROR 0x00000800 /* Set when an error occurred during the message parsing */
#define H1S_F_PROCESSING_ERROR 0x00001000 /* Set when an error occurred during the message xfer */
-#define H1S_F_ERROR_MASK 0x00001800 /* stream error mask */
+#define H1S_F_ERROR_MASK 0x00003800 /* stream error mask */
#define H1S_F_HAVE_SRV_NAME 0x00002000 /* Set during output process if the server name header was added to the request */
#define H1S_F_HAVE_O_CONN 0x00004000 /* Set during output process to know connection mode was processed */
_(H1S_F_RX_BLK, _(H1S_F_TX_BLK, _(H1S_F_RX_CONGESTED,
_(H1S_F_REOS, _(H1S_F_WANT_KAL, _(H1S_F_WANT_TUN, _(H1S_F_WANT_CLO,
_(H1S_F_NOT_FIRST, _(H1S_F_BODYLESS_RESP,
- _(H1S_F_NOT_IMPL_ERROR, _(H1S_F_PARSING_ERROR, _(H1S_F_PROCESSING_ERROR,
- _(H1S_F_HAVE_SRV_NAME, _(H1S_F_HAVE_O_CONN))))))))))))));
+ _(H1S_F_INTERNAL_ERROR, _(H1S_F_NOT_IMPL_ERROR, _(H1S_F_PARSING_ERROR, _(H1S_F_PROCESSING_ERROR,
+ _(H1S_F_HAVE_SRV_NAME, _(H1S_F_HAVE_O_CONN)))))))))))))));
/* epilogue */
_(~0U);
return buf;
h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res);
data = htx->data;
- if (h1s->flags & (H1S_F_PARSING_ERROR|H1S_F_NOT_IMPL_ERROR))
+ if (h1s->flags & (H1S_F_INTERNAL_ERROR|H1S_F_PARSING_ERROR|H1S_F_NOT_IMPL_ERROR))
goto end;
if (h1s->flags & H1S_F_RX_BLK)
TRACE_DEVEL("request headers fully parsed, create and attach the SC", H1_EV_RX_DATA, h1c->conn, h1s);
BUG_ON(h1s_sc(h1s));
if (!h1s_new_sc(h1s, buf)) {
- h1c->flags |= H1C_F_ERROR;
+ h1s->flags |= H1S_F_INTERNAL_ERROR;
goto err;
}
}
TRACE_DEVEL("request headers fully parsed, upgrade the inherited SC", H1_EV_RX_DATA, h1c->conn, h1s);
BUG_ON(h1s_sc(h1s) == NULL);
if (!h1s_upgrade_sc(h1s, buf)) {
- h1c->flags |= H1C_F_ERROR;
+ h1s->flags |= H1S_F_INTERNAL_ERROR;
TRACE_ERROR("H1S upgrade failure", H1_EV_RX_DATA|H1_EV_H1S_ERR, h1c->conn, h1s);
goto err;
}
if (htx_is_empty(chn_htx))
goto end;
- if (h1s->flags & (H1S_F_PROCESSING_ERROR|H1S_F_TX_BLK))
+ if (h1s->flags & (H1S_F_INTERNAL_ERROR|H1S_F_PROCESSING_ERROR|H1S_F_TX_BLK))
goto end;
if (!h1_get_buf(h1c, &h1c->obuf)) {
h1_set_idle_expiration(h1c);
no_parsing:
- if (h1c->flags & H1C_F_ERROR) {
+ if (h1s->flags & H1S_F_INTERNAL_ERROR) {
h1_handle_internal_err(h1c);
- h1c->flags &= ~H1C_F_WAIT_NEXT_REQ;
+ h1c->flags = (h1c->flags & ~H1C_F_WAIT_NEXT_REQ) | H1C_F_ERROR;
TRACE_ERROR("internal error detected", H1_EV_H1C_WAKE|H1_EV_H1C_ERR);
}
else if (h1s->flags & H1S_F_NOT_IMPL_ERROR) {