int stream_set_timeout(struct stream *s, enum act_timeout_name name, int timeout);
void stream_retnclose(struct stream *s, const struct buffer *msg);
void sess_set_term_flags(struct stream *s);
+void stream_abort(struct stream *s);
void service_keywords_register(struct action_kw_list *kw_list);
struct action_kw *service_find(const char *kw);
struct session *sess, struct stream *s, int flags)
{
sc_must_kill_conn(chn_prod(&s->req));
- channel_abort(&s->req);
- channel_abort(&s->res);
+ stream_abort(s);
s->req.analysers &= AN_REQ_FLT_END;
s->res.analysers &= AN_RES_FLT_END;
if (chn_prod(req)->flags & SC_FL_SHUTR) {
s->logs.logwait = 0;
s->logs.level = 0;
- channel_abort(&s->req);
- channel_abort(&s->res);
+ stream_abort(s);
req->analysers &= AN_REQ_FLT_END;
req->analyse_exp = TICK_ETERNITY;
DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s);
}
}
+/* Abort processing on the both channels in same time */
+void stream_abort(struct stream *s)
+{
+ channel_abort(&s->req);
+ channel_abort(&s->res);
+}
+
/*
* Returns a message to the client ; the connection is shut down for read,
* and the request is cleared so that no server connection can be initiated.
sw_failed:
/* immediately abort this request in case of allocation failure */
- channel_abort(&s->req);
- channel_abort(&s->res);
+ stream_abort(s);
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_RESOURCE;
*/
s->logs.logwait = 0;
s->logs.level = 0;
- channel_abort(&s->req);
- channel_abort(&s->res);
+ stream_abort(s);
s->req.analysers &= AN_REQ_FLT_END;
s->req.analyse_exp = TICK_ETERNITY;
}
if (!IS_HTX_STRM(s) && mode == PR_MODE_HTTP) {
if (!stream_set_http_mode(s, mux_proto)) {
- channel_abort(&s->req);
- channel_abort(&s->res);
+ stream_abort(s);
return ACT_RET_ABRT;
}
}
out:
/* kill the stream if any */
if (strm) {
- channel_abort(&strm->req);
- channel_abort(&strm->res);
+ stream_abort(strm);
strm->req.analysers &= AN_REQ_FLT_END;
strm->res.analysers &= AN_RES_FLT_END;
if (strm->flags & SF_BE_ASSIGNED)
reject:
sc_must_kill_conn(chn_prod(req));
- channel_abort(req);
- channel_abort(&s->res);
+ stream_abort(s);
abort:
req->analysers &= AN_REQ_FLT_END;
reject:
sc_must_kill_conn(chn_prod(rep));
- channel_abort(rep);
- channel_abort(&s->req);
+ stream_abort(s);
abort:
rep->analysers &= AN_RES_FLT_END;