The latter uses the channel wherever a channel is known.
struct proxy *px = s->be;
unsigned int plen = px->url_param_len;
unsigned long len = http_body_bytes(msg);
- const char *params = b_ptr(req->buf, -http_data_rewind(msg));
+ const char *params = c_ptr(req, -http_data_rewind(msg));
const char *p = params;
const char *start, *end;
ctx.idx = 0;
/* if the message is chunked, we skip the chunk size, but use the value as len */
- http_find_header2(px->hh_name, plen, b_ptr(s->req.buf, -http_hdr_rewind(&txn->req)), &txn->hdr_idx, &ctx);
+ http_find_header2(px->hh_name, plen, c_ptr(&s->req, -http_hdr_rewind(&txn->req)), &txn->hdr_idx, &ctx);
/* if the header is not found or empty, let's fallback to round robin */
if (!ctx.idx || !ctx.vlen)
if (!s->txn || s->txn->req.msg_state < HTTP_MSG_BODY)
break;
srv = get_server_uh(s->be,
- b_ptr(s->req.buf, -http_uri_rewind(&s->txn->req)),
+ c_ptr(&s->req, -http_uri_rewind(&s->txn->req)),
s->txn->req.sl.rq.u_l);
break;
break;
srv = get_server_ph(s->be,
- b_ptr(s->req.buf, -http_uri_rewind(&s->txn->req)),
+ c_ptr(&s->req, -http_uri_rewind(&s->txn->req)),
s->txn->req.sl.rq.u_l);
if (!srv && s->txn->meth == HTTP_METH_POST)
memcpy(chn->buf->p, msg, len);
chn->buf->o += len;
- chn->buf->p = b_ptr(chn->buf, len);
+ chn->buf->p = c_ptr(chn, len);
chn->total += len;
return -1;
}
#include <common/config.h>
#include <common/http-hdr.h>
+#include <proto/channel.h>
#include <proto/h1.h>
#include <proto/hdr_idx.h>
msg->sol = 0;
while (1) {
const char *p1 = NULL, *p2 = NULL;
- const char *start = b_ptr(buf, msg->next + msg->sol);
+ const char *start = c_ptr(msg->chn, msg->next + msg->sol);
const char *stop = b_tail(buf);
const char *ptr = start;
int bytes = 0;
c_rew(&s->req, rewind = http_hdr_rewind(&txn->req));
path = http_get_path(txn);
- len = buffer_count(s->req.buf, path, b_ptr(s->req.buf, txn->req.sl.rq.u + txn->req.sl.rq.u_l));
+ len = buffer_count(s->req.buf, path, c_ptr(&s->req, txn->req.sl.rq.u + txn->req.sl.rq.u_l));
c_adv(&s->req, rewind);
req->flags |= CF_WAKE_WRITE;
return 0;
}
- if (unlikely(ci_tail(req) < b_ptr(req->buf, msg->next) ||
+ if (unlikely(ci_tail(req) < c_ptr(req, msg->next) ||
ci_tail(req) > req->buf->data + req->buf->size - global.tune.maxrewrite))
channel_slow_realign(req, trash.str);
}
return 0;
}
- if (unlikely(ci_tail(rep) < b_ptr(rep->buf, msg->next) ||
+ if (unlikely(ci_tail(rep) < c_ptr(rep, msg->next) ||
ci_tail(rep) > rep->buf->data + rep->buf->size - global.tune.maxrewrite))
channel_slow_realign(rep, trash.str);
msg = &smp->strm->txn->rsp;
len = http_body_bytes(msg);
- body = b_ptr(msg->chn->buf, -http_data_rewind(msg));
+ body = c_ptr(msg->chn, -http_data_rewind(msg));
block1 = len;
if (block1 > msg->chn->buf->data + msg->chn->buf->size - body)
msg = &smp->strm->txn->rsp;
len = http_body_bytes(msg);
- body = b_ptr(msg->chn->buf, -http_data_rewind(msg));
+ body = c_ptr(msg->chn, -http_data_rewind(msg));
block1 = len;
if (block1 > msg->chn->buf->data + msg->chn->buf->size - body)