* If unset, then set it to zero because we really want it to
* eventually expire. We build the tarpit as an analyser.
*/
- channel_erase(&s->req);
+ channel_htx_erase(&s->req, htx);
/* wipe the request out so that we can drop the connection early
* if the client closes first.
channel_auto_read(req);
channel_abort(req);
channel_auto_close(req);
- channel_erase(req);
+ channel_htx_erase(req, htxbuf(&req->buf));
res->wex = tick_add_ifset(now_ms, res->wto);
channel_auto_read(res);
fail:
/* If an error occurred, remove the incomplete HTTP response from the
* buffer */
- channel_truncate(res);
+ channel_htx_truncate(res, htxbuf(&res->buf));
free_trash_chunk(chunk);
return 0;
}
/* If an error occurred during an Early-hint rule,
* remove the incomplete HTTP 103 response from the
* buffer */
- channel_truncate(res);
+ channel_htx_truncate(res, htx);
return -1;
}
fail:
/* If an error occurred during an Early-hint rule, remove the incomplete
* HTTP 103 response from the buffer */
- channel_truncate(res);
+ channel_htx_truncate(res, htx);
free_trash_chunk(value);
return -1;
}
channel_auto_read(req);
channel_abort(req);
channel_auto_close(req);
- channel_erase(req);
+ channel_htx_erase(req, htxbuf(&req->buf));
channel_auto_read(res);
channel_auto_close(res);
fail:
/* If an error occurred, remove the incomplete HTTP response from the
* buffer */
- channel_truncate(res);
+ channel_htx_truncate(res, htx);
}
/* This function terminates the request because it was completly analyzed or
if (unlikely(txn->req.msg_state == HTTP_MSG_ERROR ||
txn->rsp.msg_state == HTTP_MSG_ERROR)) {
channel_abort(chn);
- channel_truncate(chn);
+ channel_htx_truncate(chn, htxbuf(&chn->buf));
goto end;
}
if (unlikely(txn->req.msg_state == HTTP_MSG_ERROR ||
txn->rsp.msg_state == HTTP_MSG_ERROR)) {
- channel_truncate(&s->req);
+ channel_htx_truncate(&s->req, htxbuf(&s->req.buf));
channel_abort(&s->req);
goto end;
}
if (txn->rsp.msg_state == HTTP_MSG_CLOSED) {
http_msg_closed:
/* drop any pending data */
- channel_truncate(&s->req);
+ channel_htx_truncate(&s->req, htxbuf(&s->req.buf));
channel_abort(&s->req);
goto end;
}
channel_auto_read(si_oc(si));
channel_abort(si_oc(si));
channel_auto_close(si_oc(si));
- channel_erase(si_oc(si));
+ channel_htx_erase(si_oc(si), htxbuf(&(si_oc(si))->buf));
channel_auto_close(si_ic(si));
channel_auto_read(si_ic(si));
channel_auto_read(&s->req);
channel_abort(&s->req);
channel_auto_close(&s->req);
- channel_erase(&s->req);
- channel_truncate(&s->res);
+ channel_htx_erase(&s->req, htxbuf(&s->req.buf));
+ channel_htx_truncate(&s->res, htxbuf(&s->res.buf));
s->txn->flags &= ~TX_WAIT_NEXT_RQ;
fail:
/* If an error occurred, remove the incomplete HTTP response from the
* buffer */
- channel_truncate(res);
+ channel_htx_truncate(res, htx);
return -1;
}
channel_auto_read(&s->req);
channel_abort(&s->req);
channel_auto_close(&s->req);
- channel_erase(&s->req);
+ channel_htx_erase(&s->req, htxbuf(&s->req.buf));
res->wex = tick_add_ifset(now_ms, res->wto);
channel_auto_read(res);
fail:
/* If an error occurred, remove the incomplete HTTP response from the
* buffer */
- channel_truncate(res);
+ channel_htx_truncate(res, htx);
return -1;
}