if (sc_ep_test(sc, SE_FL_HAVE_NO_DATA))
return 0;
- if (sc_ep_test(sc, SE_FL_MAY_FASTFWD) && (sc_opposite(sc)->sedesc->iobuf.flags & IOBUF_FL_FF_BLOCKED))
+ if (sc_ep_test(sc, SE_FL_MAY_FASTFWD_PROD) && (sc_opposite(sc)->sedesc->iobuf.flags & IOBUF_FL_FF_BLOCKED))
return 0;
return !(sc->flags & (SC_FL_WONT_READ|SC_FL_NEED_BUFF|SC_FL_NEED_ROOM));
SE_FL_ERROR = 0x00010000, /* a fatal error was reported */
/* Transient flags */
SE_FL_ERR_PENDING= 0x00020000, /* An error is pending, but there's still data to be read */
- SE_FL_MAY_FASTFWD= 0x00040000, /* The endpoint may fast-forward data to the other side */
- SE_FL_RCV_MORE = 0x00080000, /* Endpoint may have more bytes to transfer */
- SE_FL_WANT_ROOM = 0x00100000, /* More bytes to transfer, but not enough room */
- SE_FL_EXP_NO_DATA= 0x00200000, /* No data expected by the endpoint */
+ SE_FL_RCV_MORE = 0x00040000, /* Endpoint may have more bytes to transfer */
+ SE_FL_WANT_ROOM = 0x00080000, /* More bytes to transfer, but not enough room */
+ SE_FL_EXP_NO_DATA= 0x00100000, /* No data expected by the endpoint */
+ SE_FL_MAY_FASTFWD_PROD = 0x00200000, /* The endpoint may produce data via zero-copy forwarding */
SE_FL_ENDP_MASK = 0x002ff000, /* Mask for flags set by the endpoint */
/* following flags are supposed to be set by the app layer and read by
_(SE_FL_T_MUX, _(SE_FL_T_APPLET, _(SE_FL_DETACHED, _(SE_FL_ORPHAN,
_(SE_FL_SHRD, _(SE_FL_SHRR, _(SE_FL_SHWN, _(SE_FL_SHWS,
_(SE_FL_NOT_FIRST, _(SE_FL_WEBSOCKET, _(SE_FL_EOI, _(SE_FL_EOS,
- _(SE_FL_ERROR, _(SE_FL_ERR_PENDING, _(SE_FL_MAY_FASTFWD,
- _(SE_FL_RCV_MORE, _(SE_FL_WANT_ROOM, _(SE_FL_EXP_NO_DATA,
+ _(SE_FL_ERROR, _(SE_FL_ERR_PENDING, _(SE_FL_RCV_MORE,
+ _(SE_FL_WANT_ROOM, _(SE_FL_EXP_NO_DATA, _(SE_FL_MAY_FASTFWD_PROD,
_(SE_FL_WAIT_FOR_HS, _(SE_FL_KILL_CONN, _(SE_FL_WAIT_DATA,
_(SE_FL_WONT_CONSUME, _(SE_FL_HAVE_NO_DATA, _(SE_FL_APPLET_NEED_CONN))))))))))))))))))))))));
/* epilogue */
len = se_nego_ff(sdo, &BUF_NULL, count, nego_flags);
if (sdo->iobuf.flags & IOBUF_FL_NO_FF) {
- sc_ep_clr(sc, SE_FL_MAY_FASTFWD);
+ sc_ep_clr(sc, SE_FL_MAY_FASTFWD_PROD);
applet_fl_clr(appctx, APPCTX_FL_FASTFWD);
TRACE_DEVEL("Fast-forwarding not supported by opposite endpoint, disable it", APPLET_EV_RECV, appctx);
goto end;
TRACE_POINT(APPLET_EV_PROCESS, app);
- if (b_data(&app->outbuf) || se_fl_test(app->sedesc, SE_FL_MAY_FASTFWD))
+ if (b_data(&app->outbuf) || se_fl_test(app->sedesc, SE_FL_MAY_FASTFWD_PROD))
applet_have_more_data(app);
sc_applet_sync_recv(sc);
ret = ff_cache_dump_msg(appctx, buf, count);
if (!appctx->to_forward) {
- se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD);
+ se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
applet_fl_clr(appctx, APPCTX_FL_FASTFWD);
if (ctx->sent == first->len - sizeof(*cache_ptr)) {
applet_set_eoi(appctx);
if (applet_fl_test(appctx, APPCTX_FL_OUTBLK_ALLOC|APPCTX_FL_OUTBLK_FULL))
goto exit;
- if (applet_fl_test(appctx, APPCTX_FL_FASTFWD) && se_fl_test(appctx->sedesc, SE_FL_MAY_FASTFWD))
+ if (applet_fl_test(appctx, APPCTX_FL_FASTFWD) && se_fl_test(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD))
goto exit;
if (!appctx_get_buf(appctx, &appctx->outbuf)) {
appctx->st0 = HTX_CACHE_EOM;
else {
if (!(global.tune.no_zero_copy_fwd & (NO_ZERO_COPY_FWD|NO_ZERO_COPY_FWD_APPLET)))
- se_fl_set(appctx->sedesc, SE_FL_MAY_FASTFWD);
+ se_fl_set(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
appctx->to_forward = cache_ptr->body_size;
len = first->len - sizeof(*cache_ptr) - ctx->sent;
/* no more data are expected. */
res_htx->flags |= HTX_FL_EOM;
applet_set_eoi(appctx);
- se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD);
+ se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
applet_fl_clr(appctx, APPCTX_FL_FASTFWD);
appctx->st0 = HTX_CACHE_END;
}
(!(h1m->flags & H1_MF_RESP) || !(h1s->flags & H1S_F_BODYLESS_RESP)) &&
(h1m->state == H1_MSG_DATA || h1m->state == H1_MSG_TUNNEL)) {
TRACE_STATE("notify the mux can use fast-forward", H1_EV_RX_DATA|H1_EV_RX_BODY, h1c->conn, h1s);
- se_fl_set(h1s->sd, SE_FL_MAY_FASTFWD);
+ se_fl_set(h1s->sd, SE_FL_MAY_FASTFWD_PROD);
}
else {
TRACE_STATE("notify the mux can't use fast-forward anymore", H1_EV_RX_DATA|H1_EV_RX_BODY, h1c->conn, h1s);
- se_fl_clr(h1s->sd, SE_FL_MAY_FASTFWD);
+ se_fl_clr(h1s->sd, SE_FL_MAY_FASTFWD_PROD);
h1c->flags &= ~H1C_F_WANT_FASTFWD;
}
else
TRACE_DEVEL("h1c ibuf not allocated", H1_EV_H1C_RECV|H1_EV_H1C_BLK, h1c->conn);
- if ((flags & CO_RFL_BUF_FLUSH) && se_fl_test(h1s->sd, SE_FL_MAY_FASTFWD)) {
+ if ((flags & CO_RFL_BUF_FLUSH) && se_fl_test(h1s->sd, SE_FL_MAY_FASTFWD_PROD)) {
h1c->flags |= H1C_F_WANT_FASTFWD;
TRACE_STATE("Block xprt rcv_buf to flush stream's buffer (want_fastfwd)", H1_EV_STRM_RECV, h1c->conn, h1s);
}
if (!(h1c->flags & H1C_F_WANT_FASTFWD)) {
TRACE_STATE("notify the mux can't use fast-forward anymore", H1_EV_STRM_RECV, h1c->conn, h1s);
- se_fl_clr(h1s->sd, SE_FL_MAY_FASTFWD);
+ se_fl_clr(h1s->sd, SE_FL_MAY_FASTFWD_PROD);
if (!(h1c->wait_event.events & SUB_RETRY_RECV)) {
TRACE_STATE("restart receiving data, subscribing", H1_EV_STRM_RECV, h1c->conn, h1s);
h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
conn->ctx = ctx;
se_fl_set(ctx->sd, SE_FL_RCV_MORE);
if (global.tune.options & GTUNE_USE_SPLICE)
- se_fl_set(ctx->sd, SE_FL_MAY_FASTFWD);
+ se_fl_set(ctx->sd, SE_FL_MAY_FASTFWD_PROD);
TRACE_LEAVE(PT_EV_CONN_NEW, conn);
return 0;
try = se_nego_ff(sdo, &BUF_NULL, count, nego_flags);
if (sdo->iobuf.flags & IOBUF_FL_NO_FF) {
/* Fast forwarding is not supported by the consumer */
- se_fl_clr(ctx->sd, SE_FL_MAY_FASTFWD);
+ se_fl_clr(ctx->sd, SE_FL_MAY_FASTFWD_PROD);
TRACE_DEVEL("Fast-forwarding not supported by opposite endpoint, disable it", PT_EV_RX_DATA, conn, sc);
goto end;
}
if (ret < 0) {
TRACE_ERROR("Error when trying to fast-forward data, disable it and abort",
PT_EV_RX_DATA|PT_EV_STRM_ERR|PT_EV_CONN_ERR, conn, sc);
- se_fl_clr(ctx->sd, SE_FL_MAY_FASTFWD);
+ se_fl_clr(ctx->sd, SE_FL_MAY_FASTFWD_PROD);
BUG_ON(sdo->iobuf.pipe->data);
put_pipe(sdo->iobuf.pipe);
sdo->iobuf.pipe = NULL;
ret = b_data(buf);
if (stats_dump_stat_to_buffer(sc, buf, NULL)) {
- se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD);
+ se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
applet_fl_clr(appctx, APPCTX_FL_FASTFWD);
appctx->st0 = STAT_HTTP_DONE;
}
if (applet_fl_test(appctx, APPCTX_FL_OUTBLK_ALLOC|APPCTX_FL_OUTBLK_FULL))
goto out;
- if (applet_fl_test(appctx, APPCTX_FL_FASTFWD) && se_fl_test(appctx->sedesc, SE_FL_MAY_FASTFWD))
+ if (applet_fl_test(appctx, APPCTX_FL_FASTFWD) && se_fl_test(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD))
goto out;
if (!appctx_get_buf(appctx, &appctx->outbuf)) {
appctx->st0 = STAT_HTTP_DONE;
else {
if (!(global.tune.no_zero_copy_fwd & (NO_ZERO_COPY_FWD|NO_ZERO_COPY_FWD_APPLET)))
- se_fl_set(appctx->sedesc, SE_FL_MAY_FASTFWD);
+ se_fl_set(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
appctx->st0 = STAT_HTTP_DUMP;
}
}
}
res_htx->flags |= HTX_FL_EOM;
applet_set_eoi(appctx);
- se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD);
+ se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
applet_fl_clr(appctx, APPCTX_FL_FASTFWD);
appctx->st0 = STAT_HTTP_END;
}
* one without using the channel buffer.
*/
if (!(global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD) &&
- sc_ep_test(sc, SE_FL_MAY_FASTFWD) && ic->to_forward) {
+ sc_ep_test(sc, SE_FL_MAY_FASTFWD_PROD) && ic->to_forward) {
if (channel_data(ic)) {
/* We're embarrassed, there are already data pending in
* the buffer and we don't want to have them at two
if (sc_ep_test(sc, SE_FL_WANT_ROOM))
sc_need_room(sc, -1);
- if (sc_ep_test(sc, SE_FL_MAY_FASTFWD) && ic->to_forward)
+ if (sc_ep_test(sc, SE_FL_MAY_FASTFWD_PROD) && ic->to_forward)
goto done_recv;
}
* one without using the channel buffer.
*/
if (!(global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD) &&
- sc_ep_test(sc, SE_FL_MAY_FASTFWD) && ic->to_forward) {
+ sc_ep_test(sc, SE_FL_MAY_FASTFWD_PROD) && ic->to_forward) {
if (channel_data(ic)) {
/* We're embarrassed, there are already data pending in
* the buffer and we don't want to have them at two
if (sc_ep_test(sc, SE_FL_WANT_ROOM))
sc_need_room(sc, -1);
- if (sc_ep_test(sc, SE_FL_MAY_FASTFWD) && ic->to_forward)
+ if (sc_ep_test(sc, SE_FL_MAY_FASTFWD_PROD) && ic->to_forward)
goto done_recv;
}