When http-buffer-request option is set on a proxy, the processing will be
paused to wait the full request payload or a full buffer. So it is an entity
that block the processing, just like a rule or a filter that yields. So now,
it is reported as a waiting entity if an error or a timeout occurred.
To do so, an stream entity type is added for this option. There is no
pointer. And "waiting_entity" sample fetch returns the option name.
* 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
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;
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;