MINOR: tree-wide: Replace several chn_cons() by the corresponding SC
At many places, call to chn_cons() can be easily replaced by the
corresponding SC. It is a bit easier to understand which side is
manipulated.
diff --git a/src/backend.c b/src/backend.c
index 7044ae1..7bc321b 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1956,7 +1956,7 @@
static int back_may_abort_req(struct channel *req, struct stream *s)
{
return (sc_ep_test(s->scf, SE_FL_ERROR) ||
- ((chn_cons(req)->flags & (SC_FL_SHUT_WANTED|SC_FL_SHUT_DONE)) && /* empty and client aborted */
+ ((s->scb->flags & (SC_FL_SHUT_WANTED|SC_FL_SHUT_DONE)) && /* empty and client aborted */
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE))));
}
@@ -2241,13 +2241,12 @@
{
struct stconn *sc = s->scb;
struct channel *req = &s->req;
- struct channel *rep = &s->res;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
/* the client might want to abort */
- if ((chn_cons(rep)->flags & SC_FL_SHUT_DONE) ||
- ((chn_cons(req)->flags & SC_FL_SHUT_WANTED) &&
+ if ((s->scf->flags & SC_FL_SHUT_DONE) ||
+ ((s->scb->flags & SC_FL_SHUT_WANTED) &&
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
sc->flags |= SC_FL_NOLINGER;
sc_shutdown(sc);
@@ -2434,7 +2433,6 @@
{
struct stconn *sc = s->scb;
struct channel *req = &s->req;
- struct channel *rep = &s->res;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
@@ -2470,8 +2468,8 @@
*/
if (!(req->flags & CF_WROTE_DATA)) {
/* client abort ? */
- if ((chn_cons(rep)->flags & SC_FL_SHUT_DONE) ||
- ((chn_cons(req)->flags & SC_FL_SHUT_WANTED) &&
+ if ((s->scf->flags & SC_FL_SHUT_DONE) ||
+ ((s->scb->flags & SC_FL_SHUT_WANTED) &&
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
/* give up */
sc->flags |= SC_FL_NOLINGER;