MINOR: http-ana: Use http_set_term_flags() when waiting the request body
When HAProxy is waiting for the request body and an abort or an error is
detected, we can now use http_set_term_flags() function to set the termination
flags of the stream instead of handling it by hand.
diff --git a/src/http_ana.c b/src/http_ana.c
index 8c32b7a..12dd487 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -947,10 +947,7 @@
/* fall through */
return_prx_cond:
- if (!(s->flags & SF_ERR_MASK))
- s->flags |= SF_ERR_PRXCOND;
- if (!(s->flags & SF_FINST_MASK))
- s->flags |= SF_FINST_R;
+ http_set_term_flags(s);
req->analysers &= AN_REQ_FLT_END;
req->analyse_exp = TICK_ETERNITY;
@@ -4223,29 +4220,26 @@
end:
return ret;
+ abort:
+ http_reply_and_close(s, txn->status, http_error_message(s));
+ ret = HTTP_RULE_RES_ABRT;
+ goto end;
+
abort_req:
txn->status = 408;
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_CLITO;
- if (!(s->flags & SF_FINST_MASK))
- s->flags |= SF_FINST_R;
_HA_ATOMIC_INC(&sess->fe->fe_counters.failed_req);
if (sess->listener && sess->listener->counters)
_HA_ATOMIC_INC(&sess->listener->counters->failed_req);
- http_reply_and_close(s, txn->status, http_error_message(s));
- ret = HTTP_RULE_RES_ABRT;
- goto end;
+ goto abort;
abort_res:
txn->status = 504;
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_SRVTO;
- if (!(s->flags & SF_FINST_MASK))
- s->flags |= SF_FINST_R;
stream_inc_http_fail_ctr(s);
- http_reply_and_close(s, txn->status, http_error_message(s));
- ret = HTTP_RULE_RES_ABRT;
- goto end;
+ goto abort;
}
void http_perform_server_redirect(struct stream *s, struct stconn *sc)