MINOR: stream-int: Remove SI_FL_DONT_WAKE to rely on CS flags instead
Flag to not wake the stream up on I/O is now handled at the conn-stream
level. Thus SI_FL_DONT_WAKE stream-int flag is replaced by CS_FL_DONT_WAKE
conn-stream flags.
diff --git a/src/cli.c b/src/cli.c
index 4d0e293..f55999e 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -2768,7 +2768,8 @@
cs_si(s->csb)->state = cs_si(s->csb)->prev_state = SI_ST_INI;
cs_si(s->csb)->err_type = SI_ET_NONE;
- cs_si(s->csb)->flags &= SI_FL_ISBACK | SI_FL_DONT_WAKE; /* we're in the context of process_stream */
+ cs_si(s->csb)->flags &= SI_FL_ISBACK; /* we're in the context of process_stream */
+ s->csb->flags &= CS_FL_ISBACK | CS_FL_DONT_WAKE; /* we're in the context of process_stream */
s->req.flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WROTE_DATA);
s->res.flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT|CF_WROTE_DATA|CF_READ_NULL);
s->flags &= ~(SF_DIRECT|SF_ASSIGNED|SF_ADDR_SET|SF_BE_ASSIGNED|SF_FORCE_PRST|SF_IGNORE_PRST);
diff --git a/src/stream.c b/src/stream.c
index a42c896..c2e0b24 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1616,9 +1616,9 @@
rqf_last = req->flags & ~CF_MASK_ANALYSER;
rpf_last = res->flags & ~CF_MASK_ANALYSER;
- /* we don't want the stream interface functions to recursively wake us up */
- si_f->flags |= SI_FL_DONT_WAKE;
- si_b->flags |= SI_FL_DONT_WAKE;
+ /* we don't want the conn-stream functions to recursively wake us up */
+ s->csf->flags |= CS_FL_DONT_WAKE;
+ s->csb->flags |= CS_FL_DONT_WAKE;
/* update pending events */
s->pending_events |= (state & TASK_WOKEN_ANY);
@@ -1675,8 +1675,8 @@
!(s->flags & SF_CONN_EXP) &&
!((s->csf->endp->flags | s->csb->flags) & CS_EP_ERROR) &&
((s->pending_events & TASK_WOKEN_ANY) == TASK_WOKEN_TIMER)) {
- si_f->flags &= ~SI_FL_DONT_WAKE;
- si_b->flags &= ~SI_FL_DONT_WAKE;
+ s->csf->flags &= ~CS_FL_DONT_WAKE;
+ s->csb->flags &= ~CS_FL_DONT_WAKE;
goto update_exp_and_leave;
}
}
@@ -2393,8 +2393,8 @@
goto resync_request;
/* we're interested in getting wakeups again */
- si_f->flags &= ~SI_FL_DONT_WAKE;
- si_b->flags &= ~SI_FL_DONT_WAKE;
+ s->csf->flags &= ~CS_FL_DONT_WAKE;
+ s->csb->flags &= ~CS_FL_DONT_WAKE;
/* This is needed only when debugging is enabled, to indicate
* client-side or server-side close. Please note that in the unlikely
@@ -2448,7 +2448,7 @@
s->pending_events = 0;
update_exp_and_leave:
- /* Note: please ensure that if you branch here you disable SI_FL_DONT_WAKE */
+ /* Note: please ensure that if you branch here you disable CS_FL_DONT_WAKE */
t->expire = tick_first((tick_is_expired(t->expire, now_ms) ? 0 : t->expire),
tick_first(tick_first(req->rex, req->wex),
tick_first(res->rex, res->wex)));
diff --git a/src/stream_interface.c b/src/stream_interface.c
index 2c196ce..66f4980 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -188,7 +188,7 @@
}
/* note that if the task exists, it must unregister itself once it runs */
- if (!(si->flags & SI_FL_DONT_WAKE))
+ if (!(si->cs->flags & CS_FL_DONT_WAKE))
task_wakeup(si_task(si), TASK_WOKEN_IO);
}
@@ -246,7 +246,7 @@
}
/* note that if the task exists, it must unregister itself once it runs */
- if (!(si->flags & SI_FL_DONT_WAKE))
+ if (!(si->cs->flags & CS_FL_DONT_WAKE))
task_wakeup(si_task(si), TASK_WOKEN_IO);
}
@@ -266,7 +266,7 @@
else {
/* (re)start reading */
tasklet_wakeup(si->wait_event.tasklet);
- if (!(si->flags & SI_FL_DONT_WAKE))
+ if (!(si->cs->flags & CS_FL_DONT_WAKE))
task_wakeup(si_task(si), TASK_WOKEN_IO);
}
}
@@ -294,7 +294,7 @@
if (!tick_isset(oc->wex))
oc->wex = tick_add_ifset(now_ms, oc->wto);
- if (!(si->flags & SI_FL_DONT_WAKE))
+ if (!(si->cs->flags & CS_FL_DONT_WAKE))
task_wakeup(si_task(si), TASK_WOKEN_IO);
}
@@ -1237,7 +1237,7 @@
((channel_is_empty(oc) && !oc->to_forward) ||
!si_state_in(si->state, SI_SB_EST))))) {
out_wakeup:
- if (!(si->flags & SI_FL_DONT_WAKE))
+ if (!(si->cs->flags & CS_FL_DONT_WAKE))
task_wakeup(si_task(si), TASK_WOKEN_IO);
}
}