mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
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.
This commit is contained in:
parent
f4569bbcc1
commit
f0d80df6e0
@ -947,10 +947,7 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit
|
|||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
return_prx_cond:
|
return_prx_cond:
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
http_set_term_flags(s);
|
||||||
s->flags |= SF_ERR_PRXCOND;
|
|
||||||
if (!(s->flags & SF_FINST_MASK))
|
|
||||||
s->flags |= SF_FINST_R;
|
|
||||||
|
|
||||||
req->analysers &= AN_REQ_FLT_END;
|
req->analysers &= AN_REQ_FLT_END;
|
||||||
req->analyse_exp = TICK_ETERNITY;
|
req->analyse_exp = TICK_ETERNITY;
|
||||||
@ -4223,29 +4220,26 @@ enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn,
|
|||||||
end:
|
end:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
abort:
|
||||||
|
http_reply_and_close(s, txn->status, http_error_message(s));
|
||||||
|
ret = HTTP_RULE_RES_ABRT;
|
||||||
|
goto end;
|
||||||
|
|
||||||
abort_req:
|
abort_req:
|
||||||
txn->status = 408;
|
txn->status = 408;
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
if (!(s->flags & SF_ERR_MASK))
|
||||||
s->flags |= SF_ERR_CLITO;
|
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);
|
_HA_ATOMIC_INC(&sess->fe->fe_counters.failed_req);
|
||||||
if (sess->listener && sess->listener->counters)
|
if (sess->listener && sess->listener->counters)
|
||||||
_HA_ATOMIC_INC(&sess->listener->counters->failed_req);
|
_HA_ATOMIC_INC(&sess->listener->counters->failed_req);
|
||||||
http_reply_and_close(s, txn->status, http_error_message(s));
|
goto abort;
|
||||||
ret = HTTP_RULE_RES_ABRT;
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
abort_res:
|
abort_res:
|
||||||
txn->status = 504;
|
txn->status = 504;
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
if (!(s->flags & SF_ERR_MASK))
|
||||||
s->flags |= SF_ERR_SRVTO;
|
s->flags |= SF_ERR_SRVTO;
|
||||||
if (!(s->flags & SF_FINST_MASK))
|
|
||||||
s->flags |= SF_FINST_R;
|
|
||||||
stream_inc_http_fail_ctr(s);
|
stream_inc_http_fail_ctr(s);
|
||||||
http_reply_and_close(s, txn->status, http_error_message(s));
|
goto abort;
|
||||||
ret = HTTP_RULE_RES_ABRT;
|
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void http_perform_server_redirect(struct stream *s, struct stconn *sc)
|
void http_perform_server_redirect(struct stream *s, struct stconn *sc)
|
||||||
|
Loading…
Reference in New Issue
Block a user