mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
BUG/MINOR: http/filters: Be sure to wait if a filter loops in HTTP_MSG_ENDING
A filter can choose to loop when a HTTP message is in the state HTTP_MSG_ENDING. But the transaction is terminated with an error if the input is closed (CF_SHUTR set on the channel). At this step, we have received all data, so we can wait. So now, we also check the parser state before leaving. This fix only affects configs that use a filter that can wait in http_forward_data or http_end callbacks, when all data were parsed.
This commit is contained in:
parent
1e59fcc588
commit
a33510b215
@ -5803,7 +5803,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
|
||||
|
||||
missing_data_or_waiting:
|
||||
/* stop waiting for data if the input is closed before the end */
|
||||
if (req->flags & CF_SHUTR) {
|
||||
if (msg->msg_state < HTTP_MSG_ENDING && req->flags & CF_SHUTR) {
|
||||
if (!(s->flags & SF_ERR_MASK))
|
||||
s->flags |= SF_ERR_CLICL;
|
||||
if (!(s->flags & SF_FINST_MASK)) {
|
||||
@ -6962,7 +6962,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
|
||||
* so we don't want to count this as a server abort. Otherwise it's a
|
||||
* server abort.
|
||||
*/
|
||||
if (res->flags & CF_SHUTR) {
|
||||
if (msg->msg_state < HTTP_MSG_ENDING && res->flags & CF_SHUTR) {
|
||||
if ((s->req.flags & (CF_SHUTR|CF_SHUTW)) == (CF_SHUTR|CF_SHUTW))
|
||||
goto aborted_xfer;
|
||||
/* If we have some pending data, we continue the processing */
|
||||
|
Loading…
Reference in New Issue
Block a user