if (h1s->flags & H1S_F_NOT_FIRST)
cs->flags |= CS_FL_NOT_FIRST;
- if (global.tune.options & GTUNE_USE_SPLICE)
+ if (global.tune.options & GTUNE_USE_SPLICE) {
+ TRACE_STATE("notify the mux can use splicing", H1_EV_STRM_NEW, h1s->h1c->conn, h1s);
cs->flags |= CS_FL_MAY_SPLICE;
+ }
if (stream_create_from_cs(cs) < 0) {
TRACE_DEVEL("leaving on stream creation failure", H1_EV_STRM_NEW|H1_EV_STRM_END|H1_EV_STRM_ERR, h1s->h1c->conn, h1s);
}
if (h1s->cs && !(h1m->flags & H1_MF_CHNK) &&
- ((h1m->state == H1_MSG_DATA && h1m->curr_len) || (h1m->state == H1_MSG_TUNNEL)))
+ ((h1m->state == H1_MSG_DATA && h1m->curr_len) || (h1m->state == H1_MSG_TUNNEL))) {
+ TRACE_STATE("notify the mux can use splicing", H1_EV_RX_DATA|H1_EV_RX_BODY, h1s->h1c->conn, h1s);
h1s->cs->flags |= CS_FL_MAY_SPLICE;
- else if (h1s->cs)
+ }
+ else if (h1s->cs) {
+ TRACE_STATE("notify the mux can't use splicing anymore", H1_EV_RX_DATA|H1_EV_RX_BODY, h1s->h1c->conn, h1s);
h1s->cs->flags &= ~CS_FL_MAY_SPLICE;
+ }
*ofs += ret;
goto end;
}
- h1s->flags &= ~H1S_F_BUF_FLUSH;
- h1s->flags |= H1S_F_SPLICED_DATA;
- TRACE_STATE("enable splicing", H1_EV_STRM_RECV, cs->conn, h1s);
+ if (!(h1s->flags & H1S_F_SPLICED_DATA)) {
+ h1s->flags &= ~H1S_F_BUF_FLUSH;
+ h1s->flags |= H1S_F_SPLICED_DATA;
+ TRACE_STATE("enable splicing", H1_EV_STRM_RECV, cs->conn, h1s);
+ }
if (!h1_recv_allowed(h1s->h1c)) {
TRACE_DEVEL("leaving on !recv_allowed", H1_EV_STRM_RECV, cs->conn, h1s);
if ((h1s->flags & H1S_F_REOS) ||
(h1m->state != H1_MSG_TUNNEL && h1m->state != H1_MSG_DATA) ||
- (h1m->state == H1_MSG_DATA && !h1m->curr_len))
+ (h1m->state == H1_MSG_DATA && !h1m->curr_len)) {
+ TRACE_STATE("notify the mux can't use splicing anymore", H1_EV_STRM_RECV, h1s->h1c->conn, h1s);
cs->flags &= ~CS_FL_MAY_SPLICE;
+ }
- TRACE_LEAVE(H1_EV_STRM_RECV, cs->conn, h1s);
+ TRACE_LEAVE(H1_EV_STRM_RECV, cs->conn, h1s,, (size_t[]){ret});
return ret;
}
}
}
- TRACE_LEAVE(H1_EV_STRM_SEND, cs->conn, h1s);
+ TRACE_LEAVE(H1_EV_STRM_SEND, cs->conn, h1s,, (size_t[]){ret});
return ret;
}
#endif