/* An abort at this stage means we are performing a "destructive"
* HTTP upgrade (TCP>H2). In this case, we can leave.
*/
- if (chn_prod(req)->flags & SC_FL_ABRT_DONE) {
+ if (s->scf->flags & SC_FL_ABRT_DONE) {
s->logs.logwait = 0;
s->logs.level = 0;
stream_abort(s);
* there and that the timeout has not expired.
*/
channel_dont_connect(req);
- if (!(chn_prod(req)->flags & SC_FL_ABRT_DONE) &&
+ if (!(s->scf->flags & SC_FL_ABRT_DONE) &&
!tick_is_expired(req->analyse_exp, now_ms)) {
/* Be sure to drain all data from the request channel */
channel_htx_erase(req, htxbuf(&req->buf));
* it can be abused to exhaust source ports. */
if (s->be->options & PR_O_ABRT_CLOSE) {
channel_auto_read(req);
- if ((chn_prod(req)->flags & SC_FL_ABRT_DONE) && !(txn->flags & TX_CON_WANT_TUN))
+ if ((s->scf->flags & SC_FL_ABRT_DONE) && !(txn->flags & TX_CON_WANT_TUN))
s->scb->flags |= SC_FL_NOLINGER;
channel_auto_close(req);
}
missing_data_or_waiting:
/* stop waiting for data if the input is closed before the end */
- if (msg->msg_state < HTTP_MSG_ENDING && chn_prod(req)->flags & SC_FL_ABRT_DONE)
+ if (msg->msg_state < HTTP_MSG_ENDING && (s->scf->flags & SC_FL_ABRT_DONE))
goto return_cli_abort;
waiting:
}
/* 3: client abort with an abortonclose */
- else if ((chn_prod(rep)->flags & SC_FL_ABRT_DONE) &&
- (chn_prod(&s->req)->flags & SC_FL_ABRT_DONE) &&
- (s->scb->flags & SC_FL_SHUT_DONE)) {
+ else if ((s->scb->flags & (SC_FL_ABRT_DONE|SC_FL_SHUT_DONE)) == (SC_FL_ABRT_DONE|SC_FL_SHUT_DONE) &&
+ (s->scf->flags & SC_FL_ABRT_DONE)) {
_HA_ATOMIC_INC(&sess->fe->fe_counters.cli_aborts);
_HA_ATOMIC_INC(&s->be->be_counters.cli_aborts);
if (sess->listener && sess->listener->counters)
}
/* 4: close from server, capture the response if the server has started to respond */
- else if (chn_prod(rep)->flags & SC_FL_ABRT_DONE) {
+ else if (s->scb->flags & SC_FL_ABRT_DONE) {
if ((txn->flags & TX_L7_RETRY) &&
(s->be->retry_type & PR_RE_DISCONNECTED)) {
if (co_data(rep) || do_l7_retry(s, s->scb) == 0) {
if (htx->data != co_data(res))
goto missing_data_or_waiting;
- if (!(msg->flags & HTTP_MSGF_XFER_LEN) && (chn_prod(res)->flags & SC_FL_ABRT_DONE)) {
+ if (!(msg->flags & HTTP_MSGF_XFER_LEN) && (s->scb->flags & SC_FL_ABRT_DONE)) {
msg->msg_state = HTTP_MSG_ENDING;
goto ending;
}
* so we don't want to count this as a server abort. Otherwise it's a
* server abort.
*/
- if (msg->msg_state < HTTP_MSG_ENDING && (chn_prod(res)->flags & SC_FL_ABRT_DONE)) {
- if ((chn_prod(&s->req)->flags & SC_FL_ABRT_DONE) &&
+ if (msg->msg_state < HTTP_MSG_ENDING && (s->scb->flags & SC_FL_ABRT_DONE)) {
+ if ((s->scf->flags & SC_FL_ABRT_DONE) &&
(s->scb->flags & SC_FL_SHUT_DONE))
goto return_cli_abort;
/* If we have some pending data, we continue the processing */
/* Always call the action function if defined */
if (rule->action_ptr) {
if (sc_ep_test(s->scf, SE_FL_ERROR) ||
- ((chn_prod(&s->req)->flags & SC_FL_ABRT_DONE) &&
+ ((s->scf->flags & SC_FL_ABRT_DONE) &&
(px->options & PR_O_ABRT_CLOSE)))
act_opts |= ACT_OPT_FINAL;
/* Always call the action function if defined */
if (rule->action_ptr) {
if (sc_ep_test(s->scf, SE_FL_ERROR) ||
- ((chn_prod(&s->req)->flags & SC_FL_ABRT_DONE) &&
+ ((s->scf->flags & SC_FL_ABRT_DONE) &&
(px->options & PR_O_ABRT_CLOSE)))
act_opts |= ACT_OPT_FINAL;
*/
if ((s->scf->flags & (SC_FL_EOI|SC_FL_ABRT_DONE)) || channel_full(req, global.tune.maxrewrite) ||
- sc_waiting_room(chn_prod(req)) ||
+ sc_waiting_room(s->scf) ||
!s->be->tcp_req.inspect_delay || tick_is_expired(s->rules_exp, now_ms)) {
partial = SMP_OPT_FINAL;
/* Action may yield while the inspect_delay is not expired and there is no read error */
_HA_ATOMIC_INC(&sess->listener->counters->failed_req);
reject:
- sc_must_kill_conn(chn_prod(req));
+ sc_must_kill_conn(s->scf);
stream_abort(s);
abort:
* - if one rule returns KO, then return KO
*/
if ((s->scb->flags & (SC_FL_EOI|SC_FL_ABRT_DONE)) || channel_full(rep, global.tune.maxrewrite) ||
- sc_waiting_room(chn_prod(rep)) ||
+ sc_waiting_room(s->scb) ||
!s->be->tcp_rep.inspect_delay || tick_is_expired(s->rules_exp, now_ms)) {
partial = SMP_OPT_FINAL;
/* Action may yield while the inspect_delay is not expired and there is no read error */
goto deny;
}
else if (rule->action == ACT_TCP_CLOSE) {
- chn_prod(rep)->flags |= SC_FL_NOLINGER | SC_FL_NOHALF;
- sc_must_kill_conn(chn_prod(rep));
- sc_abort(chn_prod(rep));
- sc_shutdown(chn_prod(rep));
+ s->scb->flags |= SC_FL_NOLINGER | SC_FL_NOHALF;
+ sc_must_kill_conn(s->scb);
+ sc_abort(s->scb);
+ sc_shutdown(s->scb);
s->last_rule_file = rule->conf.file;
s->last_rule_line = rule->conf.line;
goto end;
_HA_ATOMIC_INC(&__objt_server(s->target)->counters.failed_resp);
reject:
- sc_must_kill_conn(chn_prod(rep));
+ sc_must_kill_conn(s->scb);
stream_abort(s);
abort: