MEDIUM: channel: Use CF_READ_EVENT instead of CF_READ_PARTIAL
CF_READ_PARTIAL flag is now merged with CF_READ_EVENT. It means
CF_READ_EVENT is set when a read0 is received (formely CF_READ_NULL) or when
data are received (formely CF_READ_ACTIVITY).
There is nothing special here, except conditions to wake the stream up in
sc_notify(). Indeed, the test was a bit changed to reflect recent
change. read0 event is now formalized by (CF_READ_EVENT + CF_SHUTR).
diff --git a/src/stream.c b/src/stream.c
index 438d3ce..79815bd 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -294,7 +294,7 @@
s->req.buf = *input;
*input = BUF_NULL;
s->req.total = (IS_HTX_STRM(s) ? htxbuf(&s->req.buf)->data : b_data(&s->req.buf));
- s->req.flags |= (s->req.total ? CF_READ_PARTIAL : 0);
+ s->req.flags |= (s->req.total ? CF_READ_EVENT : 0);
}
s->flags &= ~SF_IGNORE;
@@ -567,7 +567,7 @@
s->req.buf = *input;
*input = BUF_NULL;
s->req.total = (IS_HTX_STRM(s) ? htxbuf(&s->req.buf)->data : b_data(&s->req.buf));
- s->req.flags |= (s->req.total ? CF_READ_PARTIAL : 0);
+ s->req.flags |= (s->req.total ? CF_READ_EVENT : 0);
}
/* it is important not to call the wakeup function directly but to
@@ -1516,7 +1516,7 @@
}
sc_conn_commit_endp_upgrade(sc);
- s->req.flags &= ~(CF_READ_PARTIAL|CF_AUTO_CONNECT);
+ s->req.flags &= ~(CF_READ_EVENT|CF_AUTO_CONNECT);
s->req.total = 0;
s->flags |= SF_IGNORE;
if (sc_ep_test(sc, SE_FL_DETACHED)) {
@@ -1553,8 +1553,8 @@
struct channel *req = &s->req;
struct channel *res = &s->res;
- req->flags &= ~(CF_READ_EVENT|CF_READ_PARTIAL|CF_READ_ATTACHED|CF_WRITE_EVENT|CF_WRITE_PARTIAL);
- res->flags &= ~(CF_READ_EVENT|CF_READ_PARTIAL|CF_READ_ATTACHED|CF_WRITE_EVENT|CF_WRITE_PARTIAL);
+ req->flags &= ~(CF_READ_EVENT|CF_READ_ATTACHED|CF_WRITE_EVENT|CF_WRITE_PARTIAL);
+ res->flags &= ~(CF_READ_EVENT|CF_READ_ATTACHED|CF_WRITE_EVENT|CF_WRITE_PARTIAL);
s->prev_conn_state = scb->state;
@@ -1710,7 +1710,7 @@
* to a bogus analyser or the fact that we're ignoring a read0. The
* call_rate counter only counts calls with no progress made.
*/
- if (!((req->flags | res->flags) & (CF_READ_PARTIAL|CF_WRITE_PARTIAL))) {
+ if (!((req->flags | res->flags) & (CF_READ_EVENT|CF_WRITE_PARTIAL))) {
rate = update_freq_ctr(&s->call_rate, 1);
if (rate >= 100000 && s->call_rate.prev_ctr) // make sure to wait at least a full second
stream_dump_and_crash(&s->obj_type, read_freq_ctr(&s->call_rate));