MAJOR: mux-h1/proto_htx: Switch mux-h1 and HTX analyzers on the HTX representation

The mux-h1 now parses and formats HTTP/1 messages using the HTX
representation. The HTX analyzers have been updated too. For now, only
htx_wait_for_{request/response} and http_{request/response}_forward_body have
been adapted. Others are disabled for now.

Now, the HTTP messages are parsed by the mux on a side and then, after analysis,
formatted on the other side. In the middle, in the stream, there is no more
parsing. Among other things, the version parsing is now handled by the
mux. During the data forwarding, depending the value of the "extra" field, we
are able to know if the body length is known or not and if yes, how many bytes
are still expected.
This commit is contained in:
Christopher Faulet 2018-10-22 09:34:31 +02:00 committed by Willy Tarreau
parent 0f226958b7
commit 9768c2660e
3 changed files with 848 additions and 924 deletions

File diff suppressed because it is too large Load Diff

View File

@ -393,6 +393,9 @@ int http_remove_header2(struct http_msg *msg, struct hdr_idx *idx, struct hdr_ct
static void http_server_error(struct stream *s, struct stream_interface *si,
int err, int finst, const struct buffer *msg)
{
if (IS_HTX_STRM(s))
return htx_server_error(s, si, err, finst, msg);
FLT_STRM_CB(s, flt_http_reply(s, s->txn->status, msg));
channel_auto_read(si_oc(si));
channel_abort(si_oc(si));
@ -427,6 +430,9 @@ struct buffer *http_error_message(struct stream *s)
void
http_reply_and_close(struct stream *s, short status, struct buffer *msg)
{
if (IS_HTX_STRM(s))
return htx_reply_and_close(s, status, msg);
s->txn->flags &= ~TX_WAIT_NEXT_RQ;
FLT_STRM_CB(s, flt_http_reply(s, status, msg));
stream_int_retnclose(&s->si[0], msg);

File diff suppressed because it is too large Load Diff