In applets, we stop processing when a write error (CF_WRITE_ERROR) or a shutdown
for writes (CF_SHUTW) is detected. However, any write error leads to an
immediate shutdown for writes. Thus, it is enough to only test if CF_SHUTW is
set.
unlikely(tick_is_expired(chn->rex, now_ms)))
chn->flags |= CF_READ_TIMEOUT;
- if (likely(!(chn->flags & (CF_SHUTW|CF_WRITE_TIMEOUT|CF_WRITE_EVENT|CF_WRITE_ERROR))) &&
+ if (likely(!(chn->flags & (CF_SHUTW|CF_WRITE_TIMEOUT|CF_WRITE_EVENT))) &&
unlikely(tick_is_expired(chn->wex, now_ms)))
chn->flags |= CF_WRITE_TIMEOUT;
int max_lines;
int i, j, max;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
chunk_reset(&trash);
int thr, queue;
int i, max;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
/* It's not possible to scan queues in small chunks and yield in the
struct timeval up;
int thr;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
chunk_reset(&trash);
struct stconn *sc = appctx_sc(appctx);
char **var = ctx->var;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
chunk_reset(&trash);
int fd = fdctx->fd;
int ret = 1;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto end;
chunk_reset(&trash);
struct stconn *sc = appctx_sc(appctx);
int thr;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
if (appctx->st0)
int ret = 1;
int i, fd;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto end;
chunk_reset(&trash);
const char *pfx = ctx->match;
int ret = 1;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto end;
if (!ctx->width) {
if (ds->shutdown)
goto close;
- /* an error was detected */
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto close;
/* con closed by server side, we will skip data write and drain data from channel */
struct stconn *sc = appctx_sc(appctx);
struct pat_ref_elt *elt;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW)) {
/* If we're forced to shut down, we might have to remove our
* reference to the last ref_elt being dumped.
*/
char *uptime = NULL;
char *reloadtxt = NULL;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
chunk_reset(&trash);
if (!cli_has_level(appctx, ACCESS_LVL_OPER))
return 1;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
struct stconn *sc = appctx_sc(appctx);
extern const char *monthname[12];
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
chunk_reset(&trash);
size_t len, cnt;
int ret;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
return 1;
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
/* rto should not change but it seems the case */
sc_oc(sc)->rto = TICK_ETERNITY;
- /* an error was detected */
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto close;
/* con closed by server side */
sc_oc(sc)->rto = TICK_ETERNITY;
/* an error was detected */
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto close;
/* con closed by server side */
struct ckch_store *old_ckchs, *new_ckchs = NULL;
struct ckch_inst *ckchi;
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto end;
while (1) {
/* for each bind_conf which use the crt-list, a new ckch_inst must be
* created.
*/
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
goto end;
switch (ctx->state) {
/* in case of special condition (error, shutdown, end of write...), we
* have to notify the task.
*/
- if (likely((oc->flags & (CF_WRITE_EVENT|CF_WRITE_ERROR|CF_SHUTW)) ||
+ if (likely((oc->flags & (CF_WRITE_EVENT|CF_SHUTW)) ||
((oc->flags & CF_WAKE_WRITE) &&
((channel_is_empty(oc) && !oc->to_forward) ||
!sc_state_in(sc->state, SC_SB_EST))))) {
/* update OC timeouts and wake the other side up if it's waiting for room */
if (oc->flags & (CF_WRITE_EVENT|CF_WRITE_ERROR)) {
- if ((oc->flags & (CF_SHUTW|CF_WRITE_EVENT)) == CF_WRITE_EVENT &&
+ if (!(oc->flags & CF_WRITE_ERROR) &&
!channel_is_empty(oc))
if (tick_isset(oc->wex))
oc->wex = tick_add_ifset(now_ms, oc->wto);
* data though.
*/
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW)) {
/* in case of abort, remove any refcount we might have set on an entry */
if (ctx->state == STATE_DUMP) {
stksess_kill_if_expired(ctx->t, ctx->entry, 1);
*/
if (!((req->flags | res->flags) &
(CF_SHUTR|CF_READ_EVENT|CF_READ_TIMEOUT|CF_SHUTW|
- CF_WRITE_EVENT|CF_WRITE_ERROR|CF_WRITE_TIMEOUT)) &&
+ CF_WRITE_EVENT|CF_WRITE_TIMEOUT)) &&
!(s->flags & SF_CONN_EXP) &&
!((sc_ep_get(scf) | scb->flags) & SE_FL_ERROR) &&
((s->pending_events & TASK_WOKEN_ANY) == TASK_WOKEN_TIMER)) {
goto done;
}
- if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
+ if (unlikely(sc_ic(sc)->flags & CF_SHUTW)) {
/* If we're forced to shut down, we might have to remove our
* reference to the last stream being dumped.
*/