channel_erase(chn);
}
-/* marks the channel as "shutdown" ASAP for reads */
-static inline void channel_shutr_now(struct channel *chn)
-{
- chn_prod(chn)->flags |= SC_FL_ABRT_WANTED;
-}
-
/* marks the channel as "shutdown" ASAP for writes */
static inline void channel_shutw_now(struct channel *chn)
{
}
+/* Schedule an abort for the SC */
+static inline void sc_schedule_abort(struct stconn *sc)
+{
+ sc->flags |= SC_FL_ABRT_WANTED;
+}
+
#endif /* _HAPROXY_SC_STRM_H */
return argl; /* return the number of elements in the array */
} else if (strcmp("quit", args[0]) == 0) {
- channel_shutr_now(&s->req);
+ sc_schedule_abort(s->scf);
channel_shutw_now(&s->res);
return argl; /* return the number of elements in the array */
} else if (strcmp(args[0], "operator") == 0) {
channel_auto_read(res);
channel_auto_close(res);
- channel_shutr_now(res);
+ sc_schedule_abort(s->scb);
finst = ((htxn->dir == SMP_OPT_DIR_REQ) ? SF_FINST_R : SF_FINST_D);
goto done;
goto check_channel_flags;
if (!(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))) {
- channel_shutr_now(chn);
+ sc_schedule_abort(s->scf);
channel_shutw_now(chn);
}
}
* transaction, so we can close it.
*/
if (!(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))) {
- channel_shutr_now(chn);
+ sc_schedule_abort(s->scb);
channel_shutw_now(chn);
}
}
channel_auto_read(res);
channel_auto_close(res);
- channel_shutr_now(res);
+ sc_schedule_abort(s->scb);
s->scb->flags |= SC_FL_EOI; /* The response is terminated, add EOI */
htxbuf(&res->buf)->flags |= HTX_FL_EOM; /* no more data are expected */
}
channel_htx_erase(&s->req, htxbuf(&s->req.buf));
channel_auto_read(&s->res);
channel_auto_close(&s->res);
- channel_shutr_now(&s->res);
+ sc_schedule_abort(s->scb);
}
struct http_reply *http_error_message(struct stream *s)
channel_auto_read(oc);
channel_auto_close(oc);
- channel_shutr_now(oc);
+ sc_schedule_abort(s->scb);
}
int stream_set_timeout(struct stream *s, enum act_timeout_name name, int timeout)
else {
s->scb->state = SC_ST_CLO; /* shutw+ini = abort */
channel_shutw_now(req); /* fix buffer flags upon abort */
- channel_shutr_now(res);
+ sc_schedule_abort(scb);
}
}
/* shutdown(write) done on server side, we must stop the client too */
if (unlikely((scb->flags & SC_FL_SHUTW) && !(scf->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED))) &&
!req->analysers)
- channel_shutr_now(req);
+ sc_schedule_abort(scf);
/* shutdown(read) pending */
if (unlikely((scf->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED)) == SC_FL_ABRT_WANTED)) {
/* shutdown(write) done on the client side, we must stop the server too */
if (unlikely((scf->flags & SC_FL_SHUTW) && !(scb->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED))) &&
!res->analysers)
- channel_shutr_now(res);
+ sc_schedule_abort(scb);
/* shutdown(read) pending */
if (unlikely((scb->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED)) == SC_FL_ABRT_WANTED)) {
return;
channel_shutw_now(&stream->req);
- channel_shutr_now(&stream->res);
+ sc_schedule_abort(stream->scb);
stream->task->nice = 1024;
if (!(stream->flags & SF_ERR_MASK))
stream->flags |= why;