diff --git a/include/haproxy/stream-t.h b/include/haproxy/stream-t.h index 0921cf0aa..5da8101ed 100644 --- a/include/haproxy/stream-t.h +++ b/include/haproxy/stream-t.h @@ -161,9 +161,10 @@ enum { * depending on the context; */ enum { - STRM_ENTITY_NONE = 0x0000, - STRM_ENTITY_RULE = 0x0001, - STRM_ENTITY_FILTER = 0x0002, + STRM_ENTITY_NONE = 0x0000, + STRM_ENTITY_RULE = 0x0001, + STRM_ENTITY_FILTER = 0x0002, + STRM_ENTITY_WREQ_BODY = 0x0003, }; /* This function is used to report flags in debugging tools. Please reflect diff --git a/src/http_ana.c b/src/http_ana.c index 05bc92383..ecf417e5a 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -826,8 +826,12 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit switch (http_wait_for_msg_body(s, req, s->be->timeout.httpreq, 0)) { case HTTP_RULE_RES_CONT: + s->waiting_entity.type = STRM_ENTITY_NONE; + s->waiting_entity.ptr = NULL; goto http_end; case HTTP_RULE_RES_YIELD: + s->waiting_entity.type = STRM_ENTITY_WREQ_BODY; + s->waiting_entity.ptr = NULL; goto missing_data_or_waiting; case HTTP_RULE_RES_BADREQ: goto return_bad_req; diff --git a/src/stream.c b/src/stream.c index e1a464971..d6184aae0 100644 --- a/src/stream.c +++ b/src/stream.c @@ -4189,6 +4189,12 @@ static int smp_fetch_waiting_entity(const struct arg *args, struct sample *smp, smp->data.u.str = *trash; } } + else if (smp->strm->waiting_entity.type == STRM_ENTITY_WREQ_BODY) { + struct buffer *trash = get_trash_chunk(); + + chunk_memcat(trash, "http-buffer-request", 19); + smp->data.u.str = *trash; + } else return 0;