* -1 : the SC is waiting for room but not on a specific amount of data
* >= 0 : min free space required to progress. 0 means SC must be unblocked ASAP
*/
+ unsigned long long bytes_in; /* total number of bytes received from the SE */
+ unsigned long long bytes_out; /* total number of bytes sent to the SE */
+
struct wait_event wait_event; /* We're in a wait list */
struct sedesc *sedesc; /* points to the stream endpoint descriptor */
enum obj_type *app; /* points to the applicative point (stream or check) */
sc->app_ops = NULL;
sc->src = NULL;
sc->dst = NULL;
+ sc->bytes_in = sc->bytes_out = 0;
sc->wait_event.tasklet = NULL;
sc->wait_event.events = 0;
BUG_ON(sc->sedesc);
sc->sedesc = new_sd;
sc->sedesc->sc = sc;
+ sc->bytes_in = sc->bytes_out = 0;
sc_ep_set(sc, SE_FL_DETACHED);
return 0;
}
else if (ret > 0) {
if (ic->to_forward != CHN_INFINITE_FORWARD)
ic->to_forward -= ret;
+ sc->bytes_in += ret;
ic->total += ret;
cur_read += ret;
ic->flags |= CF_READ_EVENT;
}
ic->flags |= CF_READ_EVENT;
+ sc->bytes_in += ret;
ic->total += ret;
/* End-of-input reached, we can leave. In this case, it is
send_flag |= CO_SFL_STREAMER;
ret = conn->mux->resume_fastfwd(sc, send_flag);
- if (ret > 0)
+ if (ret > 0) {
+ sc->bytes_out += ret;
did_send = 1;
+ }
if (sc_ep_have_ff_data(sc))
goto end;
did_send = 1;
c_rew(oc, ret);
c_realign_if_empty(oc);
-
+ sc->bytes_out += ret;
if (!co_data(oc)) {
/* Always clear both flags once everything has been sent, they're one-shot */
sc->flags &= ~(SC_FL_SND_ASAP|SC_FL_SND_EXP_MORE);
else if (ret > 0) {
if (ic->to_forward != CHN_INFINITE_FORWARD)
ic->to_forward -= ret;
+ sc->bytes_in += ret;
ic->total += ret;
cur_read += ret;
ic->flags |= CF_READ_EVENT;
}
ic->flags |= CF_READ_EVENT;
+ sc->bytes_in += ret;
ic->total += ret;
/* End-of-input reached, we can leave. In this case, it is
did_send = 1;
c_rew(oc, ret);
c_realign_if_empty(oc);
-
+ sc->bytes_out += ret;
if (!co_data(oc)) {
/* Always clear both flags once everything has been sent, they're one-shot */
sc->flags &= ~(SC_FL_SND_ASAP|SC_FL_SND_EXP_MORE);
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->scf->bytes_in = (IS_HTX_STRM(s) ? htxbuf(&s->req.buf)->data : b_data(&s->req.buf));
sc_ep_report_read_activity(s->scf);
}
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->scf->bytes_in = (IS_HTX_STRM(s) ? htxbuf(&s->req.buf)->data : b_data(&s->req.buf));
sc_ep_report_read_activity(s->scf);
}