It was replaced by co_head() when a channel was known, otherwise b_head().
return ret;
}
-/* Returns the start of the output data in a buffer */
-static inline char *bo_ptr(const struct buffer *b)
-{
- char *ret = b->p - b->o;
-
- if (ret < b->data)
- ret += b->size;
- return ret;
-}
-
/* Returns the end of the output data in a buffer */
static inline char *bo_end(const struct buffer *b)
{
if (len + offset > buf->o)
return 0;
- firstblock = buf->data + buf->size - bo_ptr(buf);
+ firstblock = buf->data + buf->size - b_head(buf);
if (firstblock > offset) {
if (firstblock >= len + offset) {
- memcpy(blk, bo_ptr(buf) + offset, len);
+ memcpy(blk, b_head(buf) + offset, len);
return len;
}
- memcpy(blk, bo_ptr(buf) + offset, firstblock - offset);
+ memcpy(blk, b_head(buf) + offset, firstblock - offset);
memcpy(blk + firstblock - offset, buf->data, len - firstblock + offset);
return len;
}
return 2;
}
- *blk1 = bo_ptr(buf);
+ *blk1 = b_head(buf);
*len1 = buf->o;
return 1;
}
return 0; /* no space left */
if (buffer_not_empty(b) &&
- bi_end(b) + delta > bo_ptr(b) &&
- bo_ptr(b) >= bi_end(b))
+ bi_end(b) + delta > b_head(b) &&
+ b_head(b) >= bi_end(b))
return 0; /* no space left before wrapping data */
/* first, protect the end of the buffer */
return 0; /* no space left */
if (buffer_not_empty(b) &&
- bi_end(b) + delta > bo_ptr(b) &&
- bo_ptr(b) >= bi_end(b))
+ bi_end(b) + delta > b_head(b) &&
+ b_head(b) >= bi_end(b))
return 0; /* no space left before wrapping data */
/* first, protect the end of the buffer */
goto out;
}
- p = bo_ptr(chn->buf);
+ p = b_head(chn->buf);
if (max > chn->buf->o) {
max = chn->buf->o;
/* Copy previous data from ib->o into ob->o */
if (ib->o > 0) {
left = bo_contig_data(ib);
- memcpy(ob->p - ob->o, bo_ptr(ib), left);
+ memcpy(ob->p - ob->o, b_head(ib), left);
if (ib->o - left) /* second part of the buffer */
memcpy(ob->p - ob->o + left, ib->data, ib->o - left);
}
* block does not wrap and we can safely read it this way without
* having to realign the buffer.
*/
- ret = h1_headers_to_hdr_list(bo_ptr(buf), bo_ptr(buf) + buf->o,
+ ret = h1_headers_to_hdr_list(b_head(buf), b_head(buf) + buf->o,
list, sizeof(list)/sizeof(list[0]), h1m);
if (ret <= 0) {
/* incomplete or invalid response, this is abnormal coming from
if (try < buf->o || flags & CO_SFL_MSG_MORE)
send_flag |= MSG_MORE;
- ret = send(conn->handle.fd, bo_ptr(buf), try, send_flag);
+ ret = send(conn->handle.fd, b_head(buf), try, send_flag);
if (ret > 0) {
buf->o -= ret;
break;
}
}
- ret = SSL_write_early_data(conn->xprt_ctx, bo_ptr(buf), try, &written_data);
+ ret = SSL_write_early_data(conn->xprt_ctx, b_head(buf), try, &written_data);
if (ret == 1) {
ret = written_data;
conn->sent_early_data += ret;
} else
#endif
- ret = SSL_write(conn->xprt_ctx, bo_ptr(buf), try);
+ ret = SSL_write(conn->xprt_ctx, b_head(buf), try);
if (conn->flags & CO_FL_ERROR) {
/* CO_FL_ERROR may be set by ssl_sock_infocbk */
scope_txt[0] = 0;
if (appctx->ctx.stats.scope_len) {
strcpy(scope_txt, STAT_SCOPE_PATTERN);
- memcpy(scope_txt + strlen(STAT_SCOPE_PATTERN), bo_ptr(si_ob(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
+ memcpy(scope_txt + strlen(STAT_SCOPE_PATTERN), co_head(si_oc(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
scope_txt[strlen(STAT_SCOPE_PATTERN) + appctx->ctx.stats.scope_len] = 0;
}
* name does not match, skip it.
*/
if (appctx->ctx.stats.scope_len &&
- strnistr(px->id, strlen(px->id), bo_ptr(si_ob(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len) == NULL)
+ strnistr(px->id, strlen(px->id), co_head(si_oc(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len) == NULL)
return 1;
if ((appctx->ctx.stats.flags & STAT_BOUND) &&
);
/* scope_txt = search query, appctx->ctx.stats.scope_len is always <= STAT_SCOPE_TXT_MAXLEN */
- memcpy(scope_txt, bo_ptr(si_ob(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
+ memcpy(scope_txt, co_head(si_oc(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
scope_txt[appctx->ctx.stats.scope_len] = '\0';
chunk_appendf(&trash,
scope_txt[0] = 0;
if (appctx->ctx.stats.scope_len) {
strcpy(scope_txt, STAT_SCOPE_PATTERN);
- memcpy(scope_txt + strlen(STAT_SCOPE_PATTERN), bo_ptr(si_ob(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
+ memcpy(scope_txt + strlen(STAT_SCOPE_PATTERN), co_head(si_oc(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
scope_txt[strlen(STAT_SCOPE_PATTERN) + appctx->ctx.stats.scope_len] = 0;
}
scope_txt[0] = 0;
if (appctx->ctx.stats.scope_len) {
strcpy(scope_txt, STAT_SCOPE_PATTERN);
- memcpy(scope_txt + strlen(STAT_SCOPE_PATTERN), bo_ptr(si_ob(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
+ memcpy(scope_txt + strlen(STAT_SCOPE_PATTERN), co_head(si_oc(si)) + appctx->ctx.stats.scope_str, appctx->ctx.stats.scope_len);
scope_txt[strlen(STAT_SCOPE_PATTERN) + appctx->ctx.stats.scope_len] = 0;
}