/* marks the channel as "shutdown" ASAP for writes */
static inline void channel_shutw_now(struct channel *chn)
{
- chn_cons(chn)->flags |= SC_FL_SHUTW_NOW;
+ chn_cons(chn)->flags |= SC_FL_SHUT_WANTED;
}
/* marks the channel as "shutdown" ASAP in both directions */
static inline void channel_abort(struct channel *chn)
{
chn_prod(chn)->flags |= SC_FL_ABRT_WANTED;
- chn_cons(chn)->flags |= SC_FL_SHUTW_NOW;
+ chn_cons(chn)->flags |= SC_FL_SHUT_WANTED;
chn->flags |= CF_AUTO_CLOSE;
chn->flags &= ~CF_AUTO_CONNECT;
}
{
/* closed or empty + imminent close = -2; empty = -1 */
if (unlikely((chn_cons(chn)->flags & SC_FL_SHUTW) || channel_is_empty(chn))) {
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
return -2;
return -1;
}
SC_FL_SND_EXP_MORE = 0x00001000, /* More data expected to be sent very soon. cleared when all data were sent */
SC_FL_ABRT_WANTED = 0x00002000, /* An abort was requested and must be performed ASAP */
- SC_FL_SHUTW_NOW = 0x00004000, /* SC must shut down for reads ASAP */
+ SC_FL_SHUT_WANTED = 0x00004000, /* A shutdown was requested and mux be performed ASAP */
SC_FL_SHUTR = 0x00008000, /* SC is shut down for writes */
SC_FL_SHUTW = 0x00010000, /* SC must shut down for writes ASAP */
};
_(SC_FL_DONT_WAKE, _(SC_FL_INDEP_STR, _(SC_FL_WONT_READ,
_(SC_FL_NEED_BUFF, _(SC_FL_NEED_ROOM,
_(SC_FL_RCV_ONCE, _(SC_FL_SND_ASAP, _(SC_FL_SND_NEVERWAIT, _(SC_FL_SND_EXP_MORE,
- _(SC_FL_ABRT_WANTED, _(SC_FL_SHUTW_NOW, _(SC_FL_SHUTR, _(SC_FL_SHUTW)))))))))))))))));
+ _(SC_FL_ABRT_WANTED, _(SC_FL_SHUT_WANTED, _(SC_FL_SHUTR, _(SC_FL_SHUTW)))))))))))))))));
/* epilogue */
_(~0U);
return buf;
(b_size(sc_ib(sc)) && !b_data(sc_ib(sc)) && sc->flags & SC_FL_NEED_ROOM) || // asks for room in an empty buffer
(b_data(sc_ob(sc)) && sc_is_send_allowed(sc)) || // asks for data already present
(!b_data(sc_ib(sc)) && b_data(sc_ob(sc)) && // didn't return anything ...
- (!(sc_oc(sc)->flags & CF_WRITE_EVENT) && (sc->flags & SC_FL_SHUTW_NOW))))) { // ... and left data pending after a shut
+ (!(sc_oc(sc)->flags & CF_WRITE_EVENT) && (sc->flags & SC_FL_SHUT_WANTED))))) { // ... and left data pending after a shut
rate = update_freq_ctr(&app->call_rate, 1);
if (rate >= 100000 && app->call_rate.prev_ctr) // looped like this more than 100k times over last second
stream_dump_and_crash(&app->obj_type, read_freq_ctr(&app->call_rate));
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_SHUTW_NOW|SC_FL_SHUTW)) && /* empty and client aborted */
+ ((chn_cons(req)->flags & (SC_FL_SHUT_WANTED|SC_FL_SHUTW)) && /* empty and client aborted */
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE))));
}
/* the client might want to abort */
if ((chn_cons(rep)->flags & SC_FL_SHUTW) ||
- ((chn_cons(req)->flags & SC_FL_SHUTW_NOW) &&
+ ((chn_cons(req)->flags & SC_FL_SHUT_WANTED) &&
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
sc->flags |= SC_FL_NOLINGER;
sc_shutw(sc);
if (!(req->flags & CF_WROTE_DATA)) {
/* client abort ? */
if ((chn_cons(rep)->flags & SC_FL_SHUTW) ||
- ((chn_cons(req)->flags & SC_FL_SHUTW_NOW) &&
+ ((chn_cons(req)->flags & SC_FL_SHUT_WANTED) &&
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
/* give up */
sc->flags |= SC_FL_NOLINGER;
/* closed or empty + imminent close = -1; empty = 0 */
if (unlikely((chn_cons(chn)->flags & SC_FL_SHUTW) || channel_is_empty(chn))) {
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
ret = -1;
goto out;
}
if (ret > 0 && ret < len &&
(ret < co_data(chn) || channel_may_recv(chn)) &&
!found &&
- !(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)))
+ !(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)))
ret = 0;
out:
if (max)
/* closed or empty + imminent close = -1; empty = 0 */
if (unlikely((chn_cons(chn)->flags & SC_FL_SHUTW) || channel_is_empty(chn))) {
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
ret = -1;
goto out;
}
if (ret > 0 && ret < len &&
(ret < co_data(chn) || channel_may_recv(chn)) &&
*(str-1) != sep &&
- !(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)))
+ !(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)))
ret = 0;
out:
if (max)
/* closed or empty + imminent close = -1; empty = 0 */
if (unlikely((chn_cons(chn)->flags & SC_FL_SHUTW) || channel_is_empty(chn))) {
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
ret = -1;
goto out;
}
if (ret > 0 && ret < len &&
(ret < co_data(chn) || channel_may_recv(chn)) &&
*(str-1) != '\n' &&
- !(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)))
+ !(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)))
ret = 0;
out:
if (max)
return -1;
if (unlikely(co_data(chn) == 0)) {
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
return -1;
return 0;
}
return -1;
if (len + offset > co_data(chn) || co_data(chn) == 0) {
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
return -1;
return 0;
}
int co_getblk_nc(const struct channel *chn, const char **blk1, size_t *len1, const char **blk2, size_t *len2)
{
if (unlikely(co_data(chn) == 0)) {
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
return -1;
return 0;
}
}
}
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) {
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) {
/* If we have found no LF and the buffer is shut, then
* the resulting string is made of the concatenation of
* the pending blocks (1 or 2).
sockaddr_free(&s->scb->dst);
sc_set_state(s->scb, SC_ST_INI);
- s->scb->flags &= ~(SC_FL_SHUTW|SC_FL_SHUTW_NOW);
+ s->scb->flags &= ~(SC_FL_SHUTW|SC_FL_SHUT_WANTED);
s->scb->flags &= SC_FL_ISBACK | SC_FL_DONT_WAKE; /* we're in the context of process_stream */
s->req.flags &= ~(CF_AUTO_CONNECT|CF_STREAMER|CF_STREAMER_FAST|CF_WROTE_DATA);
res->analyse_exp = TICK_ETERNITY;
res->total = 0;
- s->scb->flags &= ~(SC_FL_SHUTW|SC_FL_SHUTW_NOW);
+ s->scb->flags &= ~(SC_FL_SHUTW|SC_FL_SHUT_WANTED);
if (sc_reset_endp(s->scb) < 0) {
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_INTERNAL;
txn->rsp.msg_state != HTTP_MSG_CLOSED)
goto check_channel_flags;
- if (!(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))) {
+ if (!(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))) {
sc_schedule_abort(s->scf);
channel_shutw_now(chn);
}
check_channel_flags:
/* Here, we are in HTTP_MSG_DONE or HTTP_MSG_TUNNEL */
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) {
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) {
/* if we've just closed an output, let's switch */
txn->req.msg_state = HTTP_MSG_CLOSING;
goto http_msg_closing;
/* we're not expecting any new data to come for this
* transaction, so we can close it.
*/
- if (!(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))) {
+ if (!(chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))) {
sc_schedule_abort(s->scb);
channel_shutw_now(chn);
}
check_channel_flags:
/* Here, we are in HTTP_MSG_DONE or HTTP_MSG_TUNNEL */
- if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) {
+ if (chn_cons(chn)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) {
/* if we've just closed an output, let's switch */
txn->rsp.msg_state = HTTP_MSG_CLOSING;
goto http_msg_closing;
/* Conditionally forward the close to the write side. It return 1 if it can be
* forwarded. It is the caller responsibility to forward the close to the write
- * side. Otherwise, 0 is returned. In this case, SC_FL_SHUTW_NOW flag may be set on
+ * side. Otherwise, 0 is returned. In this case, SC_FL_SHUT_WANTED flag may be set on
* the consumer SC if we are only waiting for the outgoing data to be flushed.
*/
static inline int sc_cond_forward_shutw(struct stconn *sc)
struct channel *ic = sc_ic(sc);
struct channel *oc = sc_oc(sc);
- sc->flags &= ~SC_FL_SHUTW_NOW;
+ sc->flags &= ~SC_FL_SHUT_WANTED;
if (sc->flags & SC_FL_SHUTW)
return;
sc->flags |= SC_FL_SHUTW;
BUG_ON(!sc_conn(sc));
- sc->flags &= ~SC_FL_SHUTW_NOW;
+ sc->flags &= ~SC_FL_SHUT_WANTED;
if (sc->flags & SC_FL_SHUTW)
return;
sc->flags |= SC_FL_SHUTW;
* chunk and need to close.
*/
if ((oc->flags & CF_AUTO_CLOSE) &&
- ((sc->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) == SC_FL_SHUTW_NOW) &&
+ ((sc->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED) &&
sc_state_in(sc->state, SC_SB_RDY|SC_SB_EST)) {
sc_shutw(sc);
goto out_wakeup;
}
- if ((sc->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) == 0)
+ if ((sc->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) == 0)
sc_ep_set(sc, SE_FL_WAIT_DATA);
}
else {
BUG_ON(!sc_appctx(sc));
- sc->flags &= ~SC_FL_SHUTW_NOW;
+ sc->flags &= ~SC_FL_SHUT_WANTED;
if (sc->flags & SC_FL_SHUTW)
return;
sc->flags |= SC_FL_SHUTW;
if (channel_is_empty(oc)) {
/* stop writing */
if (!sc_ep_test(sc, SE_FL_WAIT_DATA)) {
- if ((sc->flags & SC_FL_SHUTW_NOW) == 0)
+ if ((sc->flags & SC_FL_SHUT_WANTED) == 0)
sc_ep_set(sc, SE_FL_WAIT_DATA);
}
return;
if (channel_is_empty(oc)) {
struct connection *conn = sc_conn(sc);
- if (((sc->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) == SC_FL_SHUTW_NOW) &&
+ if (((sc->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED) &&
(sc->state == SC_ST_EST) && (!conn || !(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS))))
sc_shutw(sc);
}
/* indicate that we may be waiting for data from the output channel or
- * we're about to close and can't expect more data if SC_FL_SHUTW_NOW is there.
+ * we're about to close and can't expect more data if SC_FL_SHUT_WANTED is there.
*/
- if (!(sc->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)))
+ if (!(sc->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)))
sc_ep_set(sc, SE_FL_WAIT_DATA);
- else if ((sc->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) == SC_FL_SHUTW_NOW)
+ else if ((sc->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED)
sc_ep_clr(sc, SE_FL_WAIT_DATA);
if (oc->flags & CF_DONT_READ)
(sc->flags & SC_FL_SHUTW) ||
(((oc->flags & CF_WAKE_WRITE) ||
(!(oc->flags & CF_AUTO_CLOSE) &&
- !(sc->flags & (SC_FL_SHUTW_NOW|SC_FL_SHUTW)))) &&
+ !(sc->flags & (SC_FL_SHUT_WANTED|SC_FL_SHUTW)))) &&
(sco->state != SC_ST_EST ||
(channel_is_empty(oc) && !oc->to_forward)))))) {
task_wakeup(task, TASK_WOKEN_IO);
/* OK we completely close the socket here just as if we went through sc_shut[rw]() */
sc_conn_shut(sc);
- sc->flags &= ~SC_FL_SHUTW_NOW;
+ sc->flags &= ~SC_FL_SHUT_WANTED;
sc->flags |= SC_FL_SHUTW;
sc->state = SC_ST_DIS;
cur_read += ret;
/* if we're allowed to directly forward data, we must update ->o */
- if (ic->to_forward && !(chn_cons(ic)->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))) {
+ if (ic->to_forward && !(chn_cons(ic)->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))) {
unsigned long fwd = ret;
if (ic->to_forward != CHN_INFINITE_FORWARD) {
if (fwd > ic->to_forward)
(!(sco->flags & (SC_FL_EOI|SC_FL_SHUTR)) && htx_expect_more(htxbuf(&oc->buf)))))) ||
((oc->flags & CF_ISRESP) &&
(oc->flags & CF_AUTO_CLOSE) &&
- (sc->flags & SC_FL_SHUTW_NOW)))
+ (sc->flags & SC_FL_SHUT_WANTED)))
send_flag |= CO_SFL_MSG_MORE;
if (oc->flags & CF_STREAMER)
/* Analyse request */
if (((req->flags & ~rqf_last) & CF_MASK_ANALYSER) ||
((scf->flags ^ scf_flags) & (SC_FL_SHUTR|SC_FL_ABRT_WANTED)) ||
- ((scb->flags ^ scb_flags) & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) ||
+ ((scb->flags ^ scb_flags) & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) ||
(req->analysers && (chn_cons(req)->flags & SC_FL_SHUTW)) ||
scf->state != rq_prod_last ||
scb->state != rq_cons_last ||
req->flags &= ~CF_WAKE_ONCE;
rqf_last = req->flags;
scf_flags = (scf_flags & ~(SC_FL_SHUTR|SC_FL_ABRT_WANTED)) | (scf->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED));
- scb_flags = (scb_flags & ~(SC_FL_SHUTW|SC_FL_SHUTW_NOW)) | (scb->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW));
+ scb_flags = (scb_flags & ~(SC_FL_SHUTW|SC_FL_SHUT_WANTED)) | (scb->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED));
if (((scf->flags ^ scf_flags_ana) & SC_FL_SHUTR) || ((scb->flags ^ scb_flags_ana) & SC_FL_SHUTW))
goto resync_request;
if (((res->flags & ~rpf_last) & CF_MASK_ANALYSER) ||
((scb->flags ^ scb_flags) & (SC_FL_SHUTR|SC_FL_ABRT_WANTED)) ||
- ((scf->flags ^ scf_flags) & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) ||
+ ((scf->flags ^ scf_flags) & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) ||
(res->analysers && (chn_cons(res)->flags & SC_FL_SHUTW)) ||
scf->state != rp_cons_last ||
scb->state != rp_prod_last ||
res->flags &= ~CF_WAKE_ONCE;
rpf_last = res->flags;
scb_flags = (scb_flags & ~(SC_FL_SHUTR|SC_FL_ABRT_WANTED)) | (scb->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED));
- scf_flags = (scf_flags & ~(SC_FL_SHUTW|SC_FL_SHUTW_NOW)) | (scf->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW));
+ scf_flags = (scf_flags & ~(SC_FL_SHUTW|SC_FL_SHUT_WANTED)) | (scf->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED));
if (((scb->flags ^ scb_flags_ana) & SC_FL_SHUTR) || ((scf->flags ^ scf_flags_ana) & SC_FL_SHUTW))
goto resync_response;
*/
co_set_data(req, htx->data);
if ((global.tune.options & GTUNE_USE_FAST_FWD) &&
- !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUTW_NOW))
+ !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUT_WANTED))
channel_htx_forward_forever(req, htx);
}
else {
*/
c_adv(req, ci_data(req));
if ((global.tune.options & GTUNE_USE_FAST_FWD) &&
- !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUTW_NOW))
+ !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUT_WANTED))
channel_forward_forever(req);
}
}
/* reflect what the L7 analysers have seen last */
rqf_last = req->flags;
scf_flags = (scf_flags & ~(SC_FL_SHUTR|SC_FL_ABRT_WANTED)) | (scf->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED));
- scb_flags = (scb_flags & ~(SC_FL_SHUTW|SC_FL_SHUTW_NOW)) | (scb->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW));
+ scb_flags = (scb_flags & ~(SC_FL_SHUTW|SC_FL_SHUT_WANTED)) | (scb->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED));
/* it's possible that an upper layer has requested a connection setup or abort.
* There are 2 situations where we decide to establish a new connection :
* connection setup unless the backend has abortonclose set.
*/
if (unlikely((req->flags & CF_AUTO_CLOSE) && (scf->flags & SC_FL_SHUTR) &&
- !(scb->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) &&
+ !(scb->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) &&
(scb->state != SC_ST_CON || (s->be->options & PR_O_ABRT_CLOSE)))) {
channel_shutw_now(req);
}
/* shutdown(write) pending */
- if (unlikely((scb->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) == SC_FL_SHUTW_NOW &&
+ if (unlikely((scb->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED &&
channel_is_empty(req))) {
if (sc_ep_test(s->scf, SE_FL_ERROR))
scb->flags |= SC_FL_NOLINGER;
* recent call to channel_abort().
*/
if (unlikely((!res->analysers || (res->analysers == AN_RES_FLT_END && !(res->flags & CF_FLT_ANALYZE))) &&
- !(scf->flags & SC_FL_ABRT_WANTED) && !(scb->flags & SC_FL_SHUTW_NOW) &&
+ !(scf->flags & SC_FL_ABRT_WANTED) && !(scb->flags & SC_FL_SHUT_WANTED) &&
sc_state_in(scb->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO) &&
(res->to_forward != CHN_INFINITE_FORWARD))) {
/* This buffer is freewheeling, there's no analyser
*/
co_set_data(res, htx->data);
if ((global.tune.options & GTUNE_USE_FAST_FWD) &&
- !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUTW_NOW))
+ !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUT_WANTED))
channel_htx_forward_forever(res, htx);
}
else {
*/
c_adv(res, ci_data(res));
if ((global.tune.options & GTUNE_USE_FAST_FWD) &&
- !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUTW_NOW))
+ !(scf->flags & SC_FL_SHUTR) && !(scb->flags & SC_FL_SHUT_WANTED))
channel_forward_forever(res);
}
/* reflect what the L7 analysers have seen last */
rpf_last = res->flags;
scb_flags = (scb_flags & ~(SC_FL_SHUTR|SC_FL_ABRT_WANTED)) | (scb->flags & (SC_FL_SHUTR|SC_FL_ABRT_WANTED));
- scf_flags = (scf_flags & ~(SC_FL_SHUTW|SC_FL_SHUTW_NOW)) | (scf->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW));
+ scf_flags = (scf_flags & ~(SC_FL_SHUTW|SC_FL_SHUT_WANTED)) | (scf->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED));
/* Let's see if we can send the pending response now */
sc_conn_sync_send(scf);
/* first, let's check if the response buffer needs to shutdown(write) */
if (unlikely((res->flags & CF_AUTO_CLOSE) && (scb->flags & SC_FL_SHUTR) &&
- !(scf->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)))) {
+ !(scf->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)))) {
channel_shutw_now(res);
}
/* shutdown(write) pending */
- if (unlikely((scf->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)) == SC_FL_SHUTW_NOW &&
+ if (unlikely((scf->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED &&
channel_is_empty(res))) {
sc_shutw(scf);
}
goto resync_request;
if (((scb->flags ^ scb_flags) & (SC_FL_SHUTR|SC_FL_ABRT_WANTED)) ||
- ((scf->flags ^ scf_flags) & (SC_FL_SHUTW|SC_FL_SHUTW_NOW)))
+ ((scf->flags ^ scf_flags) & (SC_FL_SHUTW|SC_FL_SHUT_WANTED)))
goto resync_response;
if (((req->flags ^ rqf_last) | (res->flags ^ rpf_last)) & CF_MASK_ANALYSER)
/* kill a stream and set the termination flags to <why> (one of SF_ERR_*) */
void stream_shutdown(struct stream *stream, int why)
{
- if (stream->scb->flags & (SC_FL_SHUTW|SC_FL_SHUTW_NOW))
+ if (stream->scb->flags & (SC_FL_SHUTW|SC_FL_SHUT_WANTED))
return;
channel_shutw_now(&stream->req);