ci_data(req),
req->analysers);
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
/* we're speaking HTTP here, so let's speak HTTP to the client */
s->srv_error = http_return_srv_error;
ci_data(req),
req->analysers);
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
/* just in case we have some per-backend tracking */
stream_inc_be_http_req_ctr(s);
* whatever we want with the remaining request. Also, now we
* may have separate values for ->fe, ->be.
*/
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
/*
* If HTTP PROXY is set we simply get remote server address parsing
ci_data(req),
req->analysers);
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
if (msg->msg_state < HTTP_MSG_BODY)
goto missing_data;
ci_data(req),
req->analysers);
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
if ((req->flags & (CF_READ_ERROR|CF_READ_TIMEOUT|CF_WRITE_ERROR|CF_WRITE_TIMEOUT)) ||
((req->flags & CF_SHUTW) && (req->to_forward || co_data(req)))) {
ci_data(rep),
rep->analysers);
- htx = htx_from_buf(&rep->buf);
+ htx = htxbuf(&rep->buf);
/*
* Now we quickly check if we have found a full valid response.
ci_data(rep),
rep->analysers);
- htx = htx_from_buf(&rep->buf);
+ htx = htxbuf(&rep->buf);
/* The stats applet needs to adjust the Connection header but we don't
* apply any filter there.
ci_data(res),
res->analysers);
- htx = htx_from_buf(&res->buf);
+ htx = htxbuf(&res->buf);
if ((res->flags & (CF_READ_ERROR|CF_READ_TIMEOUT|CF_WRITE_ERROR|CF_WRITE_TIMEOUT)) ||
((res->flags & CF_SHUTW) && (res->to_forward || co_data(res)))) {
/*
* Create the location
*/
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
switch(rule->type) {
case REDIRECT_TYPE_SCHEME: {
struct http_hdr_ctx ctx;
s->logs.tv_request = now;
data = htx->data - co_data(res);
- b_set_data(&res->buf, b_size(&res->buf));
c_adv(res, data);
res->total += data;
}
data = htx->data - co_data(res);
- b_set_data(&res->buf, b_size(&res->buf));
c_adv(res, data);
res->total += data;
return 0;
goto fail;
free_trash_chunk(value);
- b_set_data(&res->buf, b_size(&res->buf));
return 1;
fail:
int htx_req_replace_stline(int action, const char *replace, int len,
struct proxy *px, struct stream *s)
{
- struct htx *htx = htx_from_buf(&s->req.buf);
+ struct htx *htx = htxbuf(&s->req.buf);
switch (action) {
case 0: // method
*/
void htx_res_set_status(unsigned int status, const char *reason, struct stream *s)
{
- struct htx *htx = htx_from_buf(&s->res.buf);
+ struct htx *htx = htxbuf(&s->res.buf);
char *res;
chunk_reset(&trash);
int act_flags = 0;
int early_hints = 0;
- htx = htx_from_buf(&s->req.buf);
+ htx = htxbuf(&s->req.buf);
/* If "the current_rule_list" match the executed rule list, we are in
* resume condition. If a resume is needed it is always in the action
enum rule_result rule_ret = HTTP_RULE_RES_CONT;
int act_flags = 0;
- htx = htx_from_buf(&s->res.buf);
+ htx = htxbuf(&s->res.buf);
/* If "the current_rule_list" match the executed rule list, we are in
* resume condition. If a resume is needed it is always in the action
struct buffer *hdr = get_trash_chunk();
int32_t pos;
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
struct htx_blk *blk = htx_get_blk(htx, pos);
struct buffer *reqline = get_trash_chunk();
int done;
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
if (unlikely(txn->flags & (TX_CLDENY | TX_CLTARPIT)))
return 1;
struct buffer *hdr = get_trash_chunk();
int32_t pos;
- htx = htx_from_buf(&res->buf);
+ htx = htxbuf(&res->buf);
for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
struct htx_blk *blk = htx_get_blk(htx, pos);
struct buffer *resline = get_trash_chunk();
int done;
- htx = htx_from_buf(&res->buf);
+ htx = htxbuf(&res->buf);
if (unlikely(txn->flags & TX_SVDENY))
return 1;
char *prev, *att_beg, *att_end, *equal, *val_beg, *val_end, *next;
int preserve_hdr;
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
ctx.blk = NULL;
while (http_find_header(htx, ist("Cookie"), &ctx, 1)) {
del_from = NULL; /* nothing to be deleted */
char *prev, *att_beg, *att_end, *equal, *val_beg, *val_end, *next;
int is_cookie2;
- htx = htx_from_buf(&res->buf);
+ htx = htxbuf(&res->buf);
ctx.blk = NULL;
while (1) {
if ((txn->flags & (TX_CACHEABLE|TX_CACHE_IGNORE)) == TX_CACHE_IGNORE)
return; /* nothing more to do here */
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
pragma_found = cc_found = 0;
for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
struct htx_blk *blk = htx_get_blk(htx, pos);
return;
}
- htx = htx_from_buf(&res->buf);
+ htx = htxbuf(&res->buf);
for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
struct htx_blk *blk = htx_get_blk(htx, pos);
enum htx_blk_type type = htx_get_blk_type(blk);
uint32_t data;
hdr = ist2(be->server_id_hdr_name, be->server_id_hdr_len);
- htx = htx_from_buf(&s->req.buf);
+ htx = htxbuf(&s->req.buf);
data = htx->data;
ctx.blk = NULL;
if (txn->meth != HTTP_METH_GET && txn->meth != HTTP_METH_HEAD && txn->meth != HTTP_METH_POST)
return 0;
- htx = htx_from_buf(&s->req.buf);
+ htx = htxbuf(&s->req.buf);
sl = http_find_stline(htx);
uri = htx_sl_req_uri(sl);
if ((msg->flags & HTTP_MSGF_VER_11) && (txn->meth != HTTP_METH_HEAD))
appctx->ctx.stats.flags |= STAT_CHUNKED;
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
sl = http_find_stline(htx);
lookup = HTX_SL_REQ_UPTR(sl) + uri_auth->uri_len;
end = HTX_SL_REQ_UPTR(sl) + HTX_SL_REQ_ULEN(sl);
}
/* 2: add the request Path */
- htx = htx_from_buf(&req->buf);
+ htx = htxbuf(&req->buf);
sl = http_find_stline(htx);
path = http_get_path(htx_sl_req_uri(sl));
if (!path.ptr)
* Send the message
*/
data = htx->data - co_data(res);
- b_set_data(&res->buf, b_size(&res->buf));
c_adv(res, data);
res->total += data;
chn->buf.data = msg->data;
memcpy(chn->buf.area, msg->area, msg->data);
htx = htx_from_buf(&chn->buf);
- b_set_data(&chn->buf, b_size(&chn->buf));
c_adv(chn, htx->data);
chn->total += htx->data;
}
chn->buf.data = msg->data;
memcpy(chn->buf.area, msg->area, msg->data);
htx = htx_from_buf(&chn->buf);
- b_set_data(&chn->buf, b_size(&chn->buf));
c_adv(chn, htx->data);
chn->total += htx->data;
}
goto fail;
data = htx->data - co_data(res);
- b_set_data(&res->buf, b_size(&res->buf));
c_adv(res, data);
res->total += data;
return 0;
goto fail;
data = htx->data - co_data(res);
- b_set_data(&res->buf, b_size(&res->buf));
c_adv(res, data);
res->total += data;