]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: channel: finally rename the last bi_* / bo_* functions
authorWilly Tarreau <w@1wt.eu>
Thu, 19 Oct 2017 12:32:15 +0000 (14:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Oct 2017 13:01:08 +0000 (15:01 +0200)
For HTTP/2 we'll need some buffer-only equivalent functions to some of
the ones applying to channels and still squatting the bi_* / bo_*
namespace. Since these names have kept being misleading for quite some
time now and are really getting annoying, it's time to rename them. This
commit will use "ci/co" as the prefix (for "channel in", "channel out")
instead of "bi/bo". The following ones were renamed :

  bi_getblk_nc, bi_getline_nc, bi_putblk, bi_putchr,
  bo_getblk, bo_getblk_nc, bo_getline, bo_getline_nc, bo_inject,
  bi_putchk, bi_putstr, bo_getchr, bo_skip, bi_swpbuf

17 files changed:
include/proto/channel.h
src/channel.c
src/cli.c
src/dns.c
src/flt_spoe.c
src/hlua.c
src/map.c
src/memory.c
src/peers.c
src/proto_http.c
src/proxy.c
src/server.c
src/ssl_sock.c
src/stats.c
src/stick_table.c
src/stream.c
src/stream_interface.c

index bcf8e39410896dd48baa9b1a7b8b582df10e2612..51c6976382db67b90632cd46e33e9cfa78adf514 100644 (file)
@@ -45,16 +45,16 @@ int init_channel();
 unsigned long long __channel_forward(struct channel *chn, unsigned long long bytes);
 
 /* SI-to-channel functions working with buffers */
-int bi_putblk(struct channel *chn, const char *str, int len);
-struct buffer *bi_swpbuf(struct channel *chn, struct buffer *buf);
-int bi_putchr(struct channel *chn, char c);
-int bi_getline_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
-int bi_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
-int bo_inject(struct channel *chn, const char *msg, int len);
-int bo_getline(struct channel *chn, char *str, int len);
-int bo_getblk(struct channel *chn, char *blk, int len, int offset);
-int bo_getline_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
-int bo_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
+int ci_putblk(struct channel *chn, const char *str, int len);
+struct buffer *ci_swpbuf(struct channel *chn, struct buffer *buf);
+int ci_putchr(struct channel *chn, char c);
+int ci_getline_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
+int ci_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
+int co_inject(struct channel *chn, const char *msg, int len);
+int co_getline(struct channel *chn, char *str, int len);
+int co_getblk(struct channel *chn, char *blk, int len, int offset);
+int co_getline_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
+int co_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
 
 
 /* returns a pointer to the stream the channel belongs to */
@@ -479,7 +479,7 @@ static inline void channel_truncate(struct channel *chn)
  * the caller's responsibility to ensure that <len> is never larger than
  * chn->o. Channel flag WRITE_PARTIAL is set.
  */
-static inline void bo_skip(struct channel *chn, int len)
+static inline void co_skip(struct channel *chn, int len)
 {
        chn->buf->o -= len;
 
@@ -498,11 +498,11 @@ static inline void bo_skip(struct channel *chn, int len)
  * Channel flag READ_PARTIAL is updated if some data can be transferred. The
  * chunk's length is updated with the number of bytes sent.
  */
-static inline int bi_putchk(struct channel *chn, struct chunk *chunk)
+static inline int ci_putchk(struct channel *chn, struct chunk *chunk)
 {
        int ret;
 
-       ret = bi_putblk(chn, chunk->str, chunk->len);
+       ret = ci_putblk(chn, chunk->str, chunk->len);
        if (ret > 0)
                chunk->len -= ret;
        return ret;
@@ -516,19 +516,19 @@ static inline int bi_putchk(struct channel *chn, struct chunk *chunk)
  * number).  Channel flag READ_PARTIAL is updated if some data can be
  * transferred.
  */
-static inline int bi_putstr(struct channel *chn, const char *str)
+static inline int ci_putstr(struct channel *chn, const char *str)
 {
-       return bi_putblk(chn, str, strlen(str));
+       return ci_putblk(chn, str, strlen(str));
 }
 
 /*
  * Return one char from the channel's buffer. If the buffer is empty and the
  * channel is closed, return -2. If the buffer is just empty, return -1. The
- * buffer's pointer is not advanced, it's up to the caller to call bo_skip(buf,
+ * buffer's pointer is not advanced, it's up to the caller to call co_skip(buf,
  * 1) when it has consumed the char.  Also note that this function respects the
  * chn->o limit.
  */
-static inline int bo_getchr(struct channel *chn)
+static inline int co_getchr(struct channel *chn)
 {
        /* closed or empty + imminent close = -2; empty = -1 */
        if (unlikely((chn->flags & CF_SHUTW) || channel_is_empty(chn))) {
index 022807283cc247d2e0904e713bce325f952c7e65..853b85c28f755bcaeb61cfa95e11a6e65d060168 100644 (file)
@@ -75,7 +75,7 @@ unsigned long long __channel_forward(struct channel *chn, unsigned long long byt
  * data. Note: this function appends data to the buffer's output and possibly
  * overwrites any pending input data which are assumed not to exist.
  */
-int bo_inject(struct channel *chn, const char *msg, int len)
+int co_inject(struct channel *chn, const char *msg, int len)
 {
        int max;
 
@@ -109,7 +109,7 @@ int bo_inject(struct channel *chn, const char *msg, int len)
  * buffer, -1 is returned. Otherwise the number of bytes copied is returned
  * (1). Channel flag READ_PARTIAL is updated if some data can be transferred.
  */
-int bi_putchr(struct channel *chn, char c)
+int ci_putchr(struct channel *chn, char c)
 {
        if (unlikely(channel_input_closed(chn)))
                return -2;
@@ -140,7 +140,7 @@ int bi_putchr(struct channel *chn, char c)
  * number). Channel flag READ_PARTIAL is updated if some data can be
  * transferred.
  */
-int bi_putblk(struct channel *chn, const char *blk, int len)
+int ci_putblk(struct channel *chn, const char *blk, int len)
 {
        int max;
 
@@ -198,7 +198,7 @@ int bi_putblk(struct channel *chn, const char *blk, int len)
  * The chunk's length is updated with the number of bytes sent. On errors, NULL
  * is returned. Note that only buf->i is considered.
  */
-struct buffer *bi_swpbuf(struct channel *chn, struct buffer *buf)
+struct buffer *ci_swpbuf(struct channel *chn, struct buffer *buf)
 {
        struct buffer *old;
 
@@ -236,12 +236,12 @@ struct buffer *bi_swpbuf(struct channel *chn, struct buffer *buf)
  *   >0 : number of bytes read. Includes the \n if present before len or end.
  *   =0 : no '\n' before end found. <str> is left undefined.
  *   <0 : no more bytes readable because output is shut.
- * The channel status is not changed. The caller must call bo_skip() to
+ * The channel status is not changed. The caller must call co_skip() to
  * update it. The '\n' is waited for as long as neither the buffer nor the
  * output are full. If either of them is full, the string may be returned
  * as is, without the '\n'.
  */
-int bo_getline(struct channel *chn, char *str, int len)
+int co_getline(struct channel *chn, char *str, int len)
 {
        int ret, max;
        char *p;
@@ -287,10 +287,10 @@ int bo_getline(struct channel *chn, char *str, int len)
  *   >0 : number of bytes read, equal to requested size.
  *   =0 : not enough data available. <blk> is left undefined.
  *   <0 : no more bytes readable because output is shut.
- * The channel status is not changed. The caller must call bo_skip() to
+ * The channel status is not changed. The caller must call co_skip() to
  * update it.
  */
-int bo_getblk(struct channel *chn, char *blk, int len, int offset)
+int co_getblk(struct channel *chn, char *blk, int len, int offset)
 {
        int firstblock;
 
@@ -324,10 +324,10 @@ int bo_getblk(struct channel *chn, char *blk, int len, int offset)
  *   >0 : number of blocks filled (1 or 2). blk1 is always filled before blk2.
  *   =0 : not enough data available. <blk*> are left undefined.
  *   <0 : no more bytes readable because output is shut.
- * The channel status is not changed. The caller must call bo_skip() to
+ * The channel status is not changed. The caller must call co_skip() to
  * update it. Unused buffers are left in an undefined state.
  */
-int bo_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2)
+int co_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *len2)
 {
        if (unlikely(chn->buf->o == 0)) {
                if (chn->flags & CF_SHUTW)
@@ -357,14 +357,14 @@ int bo_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int *
  * full. If either of them is full, the string may be returned as is, without
  * the '\n'. Unused buffers are left in an undefined state.
  */
-int bo_getline_nc(struct channel *chn,
+int co_getline_nc(struct channel *chn,
                   char **blk1, int *len1,
                   char **blk2, int *len2)
 {
        int retcode;
        int l;
 
-       retcode = bo_getblk_nc(chn, blk1, len1, blk2, len2);
+       retcode = co_getblk_nc(chn, blk1, len1, blk2, len2);
        if (unlikely(retcode) <= 0)
                return retcode;
 
@@ -401,7 +401,7 @@ int bo_getline_nc(struct channel *chn,
  *   =0 : not enough data available.
  *   <0 : no more bytes readable because input is shut.
  */
-int bi_getblk_nc(struct channel *chn,
+int ci_getblk_nc(struct channel *chn,
                  char **blk1, int *len1,
                  char **blk2, int *len2)
 {
@@ -433,14 +433,14 @@ int bi_getblk_nc(struct channel *chn,
  * full. If either of them is full, the string may be returned as is, without
  * the '\n'. Unused buffers are left in an undefined state.
  */
-int bi_getline_nc(struct channel *chn,
+int ci_getline_nc(struct channel *chn,
                   char **blk1, int *len1,
                   char **blk2, int *len2)
 {
        int retcode;
        int l;
 
-       retcode = bi_getblk_nc(chn, blk1, len1, blk2, len2);
+       retcode = ci_getblk_nc(chn, blk1, len1, blk2, len2);
        if (unlikely(retcode <= 0))
                return retcode;
 
index bfed024a82d0c7a40ec5542049bf03a7ff8bd9fc..97e3086e6056cba913420dfa31f937439e5948a8 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -485,7 +485,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
        struct chunk *tmp;
 
        if (likely(severity_output == CLI_SEVERITY_NONE))
-               return bi_putblk(chn, msg, strlen(msg));
+               return ci_putblk(chn, msg, strlen(msg));
 
        tmp = get_trash_chunk();
        chunk_reset(tmp);
@@ -508,7 +508,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
        }
        chunk_appendf(tmp, "%s", msg);
 
-       return bi_putblk(chn, tmp->str, strlen(tmp->str));
+       return ci_putblk(chn, tmp->str, strlen(tmp->str));
 }
 
 /* This I/O handler runs as an applet embedded in a stream interface. It is
@@ -561,7 +561,7 @@ static void cli_io_handler(struct appctx *appctx)
                                break;
                        }
 
-                       reql = bo_getline(si_oc(si), trash.str, trash.size);
+                       reql = co_getline(si_oc(si), trash.str, trash.size);
                        if (reql <= 0) { /* closed or EOL not found */
                                if (reql == 0)
                                        break;
@@ -642,7 +642,7 @@ static void cli_io_handler(struct appctx *appctx)
                        }
 
                        /* re-adjust req buffer */
-                       bo_skip(si_oc(si), reql);
+                       co_skip(si_oc(si), reql);
                        req->flags |= CF_READ_DONTWAIT; /* we plan to read small requests */
                }
                else {  /* output functions */
@@ -681,7 +681,7 @@ static void cli_io_handler(struct appctx *appctx)
 
                        /* The post-command prompt is either LF alone or LF + '> ' in interactive mode */
                        if (appctx->st0 == CLI_ST_PROMPT) {
-                               if (bi_putstr(si_ic(si), appctx->st1 ? "\n> " : "\n") != -1)
+                               if (ci_putstr(si_ic(si), appctx->st1 ? "\n> " : "\n") != -1)
                                        appctx->st0 = CLI_ST_GETREQ;
                                else
                                        si_applet_cant_put(si);
@@ -771,7 +771,7 @@ static int cli_io_handler_show_env(struct appctx *appctx)
        while (*var) {
                chunk_printf(&trash, "%s\n", *var);
 
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -869,7 +869,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
 
                chunk_appendf(&trash, "\n");
 
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -899,7 +899,7 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
        switch (appctx->st2) {
                case STAT_ST_INIT:
                        chunk_printf(&trash, "# socket lvl processes\n");
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -966,7 +966,7 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
                                                        chunk_appendf(&trash, "all\n");
                                                }
 
-                                               if (bi_putchk(si_ic(si), &trash) == -1) {
+                                               if (ci_putchk(si_ic(si), &trash) == -1) {
                                                        si_applet_cant_put(si);
                                                        return 0;
                                                }
index 926e189a5db092b501838c6ae57d6f7d06f82be1..dbb473e29f6adf25b781e637afb26451d8ac4ba5 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -2657,7 +2657,7 @@ static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
                }
 
                /* display response */
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        /* let's try again later from this session. We add ourselves into
                         * this session's users so that it can remove us upon termination.
                         */
index 08eb0b8137ffb4c3cf917fbb1e242d86eac42312..1d4b0c8ce63b4be2ffb6daa13d703b5508f4f41a 100644 (file)
@@ -1110,7 +1110,7 @@ spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz)
         * length. */
        netint = htonl(framesz);
        memcpy(buf, (char *)&netint, 4);
-       ret = bi_putblk(si_ic(si), buf, framesz+4);
+       ret = ci_putblk(si_ic(si), buf, framesz+4);
 
        if (ret <= 0) {
                if (ret == -1) {
@@ -1137,14 +1137,14 @@ spoe_recv_frame(struct appctx *appctx, char *buf, size_t framesz)
        if (si_oc(si)->buf == &buf_empty)
                goto retry;
 
-       ret = bo_getblk(si_oc(si), (char *)&netint, 4, 0);
+       ret = co_getblk(si_oc(si), (char *)&netint, 4, 0);
        if (ret > 0) {
                framesz = ntohl(netint);
                if (framesz > SPOE_APPCTX(appctx)->max_frame_size) {
                        SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_TOO_BIG;
                        return -1;
                }
-               ret = bo_getblk(si_oc(si), buf, framesz, 4);
+               ret = co_getblk(si_oc(si), buf, framesz, 4);
        }
        if (ret <= 0) {
                if (ret == 0) {
@@ -1407,7 +1407,7 @@ spoe_handle_connecting_appctx(struct appctx *appctx)
   next:
        /* Do not forget to remove processed frame from the output buffer */
        if (trash.len)
-               bo_skip(si_oc(si), trash.len);
+               co_skip(si_oc(si), trash.len);
 
        SPOE_APPCTX(appctx)->task->expire =
                tick_add_ifset(now_ms, agent->timeout.idle);
@@ -1583,7 +1583,7 @@ spoe_handle_receiving_frame_appctx(struct appctx *appctx, int *skip)
 
        /* Do not forget to remove processed frame from the output buffer */
        if (trash.len)
-               bo_skip(si_oc(appctx->owner), trash.len);
+               co_skip(si_oc(appctx->owner), trash.len);
   end:
        return ret;
 }
@@ -1798,7 +1798,7 @@ spoe_handle_disconnecting_appctx(struct appctx *appctx)
   next:
        /* Do not forget to remove processed frame from the output buffer */
        if (trash.len)
-               bo_skip(si_oc(appctx->owner), trash.len);
+               co_skip(si_oc(appctx->owner), trash.len);
 
        return 0;
   stop:
index 7eddda8217870c75e341e46210abf06a5c388b91..f5fed044ad976ed316a876c71ee1330f73089ddc 100644 (file)
@@ -1662,7 +1662,7 @@ __LJMP static int hlua_socket_receive_yield(struct lua_State *L, int status, lua
        oc = &s->res;
        if (wanted == HLSR_READ_LINE) {
                /* Read line. */
-               nblk = bo_getline_nc(oc, &blk1, &len1, &blk2, &len2);
+               nblk = co_getline_nc(oc, &blk1, &len1, &blk2, &len2);
                if (nblk < 0) /* Connection close. */
                        goto connection_closed;
                if (nblk == 0) /* No data avalaible. */
@@ -1693,7 +1693,7 @@ __LJMP static int hlua_socket_receive_yield(struct lua_State *L, int status, lua
 
        else if (wanted == HLSR_READ_ALL) {
                /* Read all the available data. */
-               nblk = bo_getblk_nc(oc, &blk1, &len1, &blk2, &len2);
+               nblk = co_getblk_nc(oc, &blk1, &len1, &blk2, &len2);
                if (nblk < 0) /* Connection close. */
                        goto connection_closed;
                if (nblk == 0) /* No data avalaible. */
@@ -1702,7 +1702,7 @@ __LJMP static int hlua_socket_receive_yield(struct lua_State *L, int status, lua
 
        else {
                /* Read a block of data. */
-               nblk = bo_getblk_nc(oc, &blk1, &len1, &blk2, &len2);
+               nblk = co_getblk_nc(oc, &blk1, &len1, &blk2, &len2);
                if (nblk < 0) /* Connection close. */
                        goto connection_closed;
                if (nblk == 0) /* No data avalaible. */
@@ -1724,7 +1724,7 @@ __LJMP static int hlua_socket_receive_yield(struct lua_State *L, int status, lua
        }
 
        /* Consume data. */
-       bo_skip(oc, len + skip_at_end);
+       co_skip(oc, len + skip_at_end);
 
        /* Don't wait anything. */
        stream_int_notify(&s->si[0]);
@@ -1904,7 +1904,7 @@ static int hlua_socket_write_yield(struct lua_State *L,int status, lua_KContext
        /* send data */
        if (len < send_len)
                send_len = len;
-       len = bi_putblk(&s->req, buf+sent, send_len);
+       len = ci_putblk(&s->req, buf+sent, send_len);
 
        /* "Not enough space" (-1), "Buffer too little to contain
         * the data" (-2) are not expected because the available length
@@ -2551,7 +2551,7 @@ static inline int _hlua_channel_dup(struct channel *chn, lua_State *L)
        int ret;
        luaL_Buffer b;
 
-       ret = bi_getblk_nc(chn, &blk1, &len1, &blk2, &len2);
+       ret = ci_getblk_nc(chn, &blk1, &len1, &blk2, &len2);
        if (unlikely(ret == 0))
                return 0;
 
@@ -2643,7 +2643,7 @@ __LJMP static int hlua_channel_getline_yield(lua_State *L, int status, lua_KCont
 
        chn = MAY_LJMP(hlua_checkchannel(L, 1));
 
-       ret = bi_getline_nc(chn, &blk1, &len1, &blk2, &len2);
+       ret = ci_getline_nc(chn, &blk1, &len1, &blk2, &len2);
        if (ret == 0)
                WILL_LJMP(hlua_yieldk(L, 0, 0, hlua_channel_getline_yield, TICK_ETERNITY, 0));
 
@@ -2701,7 +2701,7 @@ __LJMP static int hlua_channel_append_yield(lua_State *L, int status, lua_KConte
        if (max > len - l)
                max = len - l;
 
-       ret = bi_putblk(chn, str + l, max);
+       ret = ci_putblk(chn, str + l, max);
        if (ret == -2 || ret == -3) {
                lua_pushinteger(L, -1);
                return 1;
@@ -3411,7 +3411,7 @@ __LJMP static int hlua_applet_tcp_getline_yield(lua_State *L, int status, lua_KC
        int len2;
 
        /* Read the maximum amount of data avalaible. */
-       ret = bo_getline_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
+       ret = co_getline_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
 
        /* Data not yet avalaible. return yield. */
        if (ret == 0) {
@@ -3434,7 +3434,7 @@ __LJMP static int hlua_applet_tcp_getline_yield(lua_State *L, int status, lua_KC
        luaL_addlstring(&appctx->b, blk2, len2);
 
        /* Consume input channel output buffer data. */
-       bo_skip(si_oc(si), len1 + len2);
+       co_skip(si_oc(si), len1 + len2);
        luaL_pushresult(&appctx->b);
        return 1;
 }
@@ -3466,7 +3466,7 @@ __LJMP static int hlua_applet_tcp_recv_yield(lua_State *L, int status, lua_KCont
        int len2;
 
        /* Read the maximum amount of data avalaible. */
-       ret = bo_getblk_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
+       ret = co_getblk_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
 
        /* Data not yet avalaible. return yield. */
        if (ret == 0) {
@@ -3492,7 +3492,7 @@ __LJMP static int hlua_applet_tcp_recv_yield(lua_State *L, int status, lua_KCont
                 */
                luaL_addlstring(&appctx->b, blk1, len1);
                luaL_addlstring(&appctx->b, blk2, len2);
-               bo_skip(si_oc(si), len1 + len2);
+               co_skip(si_oc(si), len1 + len2);
                si_applet_cant_get(si);
                WILL_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_recv_yield, TICK_ETERNITY, 0));
 
@@ -3511,7 +3511,7 @@ __LJMP static int hlua_applet_tcp_recv_yield(lua_State *L, int status, lua_KCont
                len -= len2;
 
                /* Consume input channel output buffer data. */
-               bo_skip(si_oc(si), len1 + len2);
+               co_skip(si_oc(si), len1 + len2);
 
                /* If we are no other data avalaible, yield waiting for new data. */
                if (len > 0) {
@@ -3575,7 +3575,7 @@ __LJMP static int hlua_applet_tcp_send_yield(lua_State *L, int status, lua_KCont
                max = len - l;
 
        /* Copy data. */
-       bi_putblk(chn, str + l, max);
+       ci_putblk(chn, str + l, max);
 
        /* update counters. */
        l += max;
@@ -3875,7 +3875,7 @@ __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_K
 
        /* Maybe we cant send a 100-continue ? */
        if (appctx->appctx->ctx.hlua_apphttp.flags & APPLET_100C) {
-               ret = bi_putblk(chn, HTTP_100C, strlen(HTTP_100C));
+               ret = ci_putblk(chn, HTTP_100C, strlen(HTTP_100C));
                /* if ret == -2 or -3 the channel closed or the message si too
                 * big for the buffers. We cant send anything. So, we ignoring
                 * the error, considers that the 100-continue is sent, and try
@@ -3896,7 +3896,7 @@ __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_K
        }
 
        /* Read the maximum amount of data avalaible. */
-       ret = bo_getline_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
+       ret = co_getline_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
 
        /* Data not yet avalaible. return yield. */
        if (ret == 0) {
@@ -3927,7 +3927,7 @@ __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_K
        appctx->appctx->ctx.hlua_apphttp.left_bytes -= len2;
 
        /* Consume input channel output buffer data. */
-       bo_skip(si_oc(si), len1 + len2);
+       co_skip(si_oc(si), len1 + len2);
        luaL_pushresult(&appctx->b);
        return 1;
 }
@@ -3961,7 +3961,7 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon
 
        /* Maybe we cant send a 100-continue ? */
        if (appctx->appctx->ctx.hlua_apphttp.flags & APPLET_100C) {
-               ret = bi_putblk(chn, HTTP_100C, strlen(HTTP_100C));
+               ret = ci_putblk(chn, HTTP_100C, strlen(HTTP_100C));
                /* if ret == -2 or -3 the channel closed or the message si too
                 * big for the buffers. We cant send anything. So, we ignoring
                 * the error, considers that the 100-continue is sent, and try
@@ -3976,7 +3976,7 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon
        }
 
        /* Read the maximum amount of data avalaible. */
-       ret = bo_getblk_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
+       ret = co_getblk_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
 
        /* Data not yet avalaible. return yield. */
        if (ret == 0) {
@@ -4007,7 +4007,7 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon
        len -= len2;
 
        /* Consume input channel output buffer data. */
-       bo_skip(si_oc(si), len1 + len2);
+       co_skip(si_oc(si), len1 + len2);
        if (appctx->appctx->ctx.hlua_apphttp.left_bytes != -1)
                appctx->appctx->ctx.hlua_apphttp.left_bytes -= len;
 
@@ -4070,7 +4070,7 @@ __LJMP static int hlua_applet_http_send_yield(lua_State *L, int status, lua_KCon
                max = len - l;
 
        /* Copy data. */
-       bi_putblk(chn, str + l, max);
+       ci_putblk(chn, str + l, max);
 
        /* update counters. */
        l += max;
@@ -4209,7 +4209,7 @@ __LJMP static int hlua_applet_http_start_response_yield(lua_State *L, int status
        msg = MAY_LJMP(luaL_checklstring(L, 2, &len));
 
        /* Send the message at once. */
-       ret = bi_putblk(chn, msg, len);
+       ret = ci_putblk(chn, msg, len);
 
        /* if ret == -2 or -3 the channel closed or the message si too
         * big for the buffers.
@@ -6136,7 +6136,7 @@ static void hlua_applet_tcp_fct(struct appctx *ctx)
                strm->logs.tv_request = now;
 
                /* eat the whole request */
-               bo_skip(si_oc(si), si_ob(si)->o);
+               co_skip(si_oc(si), si_ob(si)->o);
                res->flags |= CF_READ_NULL;
                si_shutr(si);
                return;
@@ -6352,7 +6352,7 @@ static void hlua_applet_http_fct(struct appctx *ctx)
                 */
 
                /* Read the maximum amount of data avalaible. */
-               ret = bo_getblk_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
+               ret = co_getblk_nc(si_oc(si), &blk1, &len1, &blk2, &len2);
                if (ret == -1)
                        return;
 
@@ -6367,7 +6367,7 @@ static void hlua_applet_http_fct(struct appctx *ctx)
                }
 
                /* skip the requests bytes. */
-               bo_skip(si_oc(si), strm->txn->req.eoh + 2);
+               co_skip(si_oc(si), strm->txn->req.eoh + 2);
        }
 
        /* Executes The applet if it is not done. */
@@ -6412,7 +6412,7 @@ static void hlua_applet_http_fct(struct appctx *ctx)
                    !(ctx->ctx.hlua_apphttp.flags & APPLET_LAST_CHK)) {
 
                        /* sent last chunk at once. */
-                       ret = bi_putblk(res, "0\r\n\r\n", 5);
+                       ret = ci_putblk(res, "0\r\n\r\n", 5);
 
                        /* critical error. */
                        if (ret == -2 || ret == -3) {
@@ -6438,7 +6438,7 @@ static void hlua_applet_http_fct(struct appctx *ctx)
                strm->logs.tv_request = now;
 
                /* eat the whole request */
-               bo_skip(si_oc(si), si_ob(si)->o);
+               co_skip(si_oc(si), si_ob(si)->o);
                res->flags |= CF_READ_NULL;
                si_shutr(si);
 
@@ -6452,7 +6452,7 @@ error:
         * if there are no room avalaible in the buffer,
         * just close the connection.
         */
-       bi_putblk(res, error_500, strlen(error_500));
+       ci_putblk(res, error_500, strlen(error_500));
        if (!(strm->flags & SF_ERR_MASK))
                strm->flags |= SF_ERR_RESOURCE;
        si_shutw(si);
index 816fd66317b02204b45fdf29bb73fb6493893839..dc4dd9533f0f56cf8d49a535e9e784ce06d1dc70 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -350,7 +350,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
                                chunk_appendf(&trash, "%p %s\n",
                                              elt, elt->pattern);
 
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
@@ -384,7 +384,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
                 */
                chunk_reset(&trash);
                chunk_appendf(&trash, "# id (file) description\n");
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -411,7 +411,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
                                      appctx->ctx.map.ref->reference ? appctx->ctx.map.ref->reference : "",
                                      appctx->ctx.map.ref->display);
 
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
@@ -530,7 +530,7 @@ static int cli_io_handler_map_lookup(struct appctx *appctx)
                        chunk_appendf(&trash, "\n");
 
                        /* display response */
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
index 9f8396d5b554b30b9f1a054f3a3c0cfd0a960868..24e1df706c88a3531ee4f91b8d92d56d53ad0ef4 100644 (file)
@@ -282,7 +282,7 @@ static int cli_io_handler_dump_pools(struct appctx *appctx)
        struct stream_interface *si = appctx->owner;
 
        dump_pools_to_trash();
-       if (bi_putchk(si_ic(si), &trash) == -1) {
+       if (ci_putchk(si_ic(si), &trash) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
index 21a556bcdb68fe49cb8e8e3482c8d21da14091a2..4c85af5aac46a87ced0076f62c4a45adb93e06d4 100644 (file)
@@ -581,7 +581,7 @@ switchstate:
                                appctx->st0 = PEER_SESS_ST_GETVERSION;
                                /* fall through */
                        case PEER_SESS_ST_GETVERSION:
-                               reql = bo_getline(si_oc(si), trash.str, trash.size);
+                               reql = co_getline(si_oc(si), trash.str, trash.size);
                                if (reql <= 0) { /* closed or EOL not found */
                                        if (reql == 0)
                                                goto out;
@@ -597,7 +597,7 @@ switchstate:
                                else
                                        trash.str[reql-1] = 0;
 
-                               bo_skip(si_oc(si), reql);
+                               co_skip(si_oc(si), reql);
 
                                /* test protocol */
                                if (strncmp(PEER_SESSION_PROTO_NAME " ", trash.str, proto_len + 1) != 0) {
@@ -615,7 +615,7 @@ switchstate:
                                appctx->st0 = PEER_SESS_ST_GETHOST;
                                /* fall through */
                        case PEER_SESS_ST_GETHOST:
-                               reql = bo_getline(si_oc(si), trash.str, trash.size);
+                               reql = co_getline(si_oc(si), trash.str, trash.size);
                                if (reql <= 0) { /* closed or EOL not found */
                                        if (reql == 0)
                                                goto out;
@@ -631,7 +631,7 @@ switchstate:
                                else
                                        trash.str[reql-1] = 0;
 
-                               bo_skip(si_oc(si), reql);
+                               co_skip(si_oc(si), reql);
 
                                /* test hostname match */
                                if (strcmp(localpeer, trash.str) != 0) {
@@ -645,7 +645,7 @@ switchstate:
                        case PEER_SESS_ST_GETPEER: {
                                struct peer *curpeer;
                                char *p;
-                               reql = bo_getline(si_oc(si), trash.str, trash.size);
+                               reql = co_getline(si_oc(si), trash.str, trash.size);
                                if (reql <= 0) { /* closed or EOL not found */
                                        if (reql == 0)
                                                goto out;
@@ -662,7 +662,7 @@ switchstate:
                                else
                                        trash.str[reql-1] = 0;
 
-                               bo_skip(si_oc(si), reql);
+                               co_skip(si_oc(si), reql);
 
                                /* parse line "<peer name> <pid> <relative_pid>" */
                                p = strchr(trash.str, ' ');
@@ -713,7 +713,7 @@ switchstate:
                                struct shared_table *st;
 
                                repl = snprintf(trash.str, trash.size, "%d\n", PEER_SESS_SC_SUCCESSCODE);
-                               repl = bi_putblk(si_ic(si), trash.str, repl);
+                               repl = ci_putblk(si_ic(si), trash.str, repl);
                                if (repl <= 0) {
                                        if (repl == -1)
                                                goto full;
@@ -781,7 +781,7 @@ switchstate:
                                        goto switchstate;
                                }
 
-                               repl = bi_putblk(si_ic(si), trash.str, repl);
+                               repl = ci_putblk(si_ic(si), trash.str, repl);
                                if (repl <= 0) {
                                        if (repl == -1)
                                                goto full;
@@ -800,7 +800,7 @@ switchstate:
                                if (si_ic(si)->flags & CF_WRITE_PARTIAL)
                                        curpeer->statuscode = PEER_SESS_SC_CONNECTEDCODE;
 
-                               reql = bo_getline(si_oc(si), trash.str, trash.size);
+                               reql = co_getline(si_oc(si), trash.str, trash.size);
                                if (reql <= 0) { /* closed or EOL not found */
                                        if (reql == 0)
                                                goto out;
@@ -817,7 +817,7 @@ switchstate:
                                else
                                        trash.str[reql-1] = 0;
 
-                               bo_skip(si_oc(si), reql);
+                               co_skip(si_oc(si), reql);
 
                                /* Register status code */
                                curpeer->statuscode = atoi(trash.str);
@@ -876,7 +876,7 @@ switchstate:
                                unsigned char msg_head[7];
                                int totl = 0;
 
-                               reql = bo_getblk(si_oc(si), (char *)msg_head, 2*sizeof(unsigned char), totl);
+                               reql = co_getblk(si_oc(si), (char *)msg_head, 2*sizeof(unsigned char), totl);
                                if (reql <= 0) /* closed or EOL not found */
                                        goto incomplete;
 
@@ -884,7 +884,7 @@ switchstate:
 
                                if (msg_head[1] >= 128) {
                                        /* Read and Decode message length */
-                                       reql = bo_getblk(si_oc(si), (char *)&msg_head[2], sizeof(unsigned char), totl);
+                                       reql = co_getblk(si_oc(si), (char *)&msg_head[2], sizeof(unsigned char), totl);
                                        if (reql <= 0) /* closed */
                                                goto incomplete;
 
@@ -899,7 +899,7 @@ switchstate:
                                                char *end;
 
                                                for (i = 3 ; i < sizeof(msg_head) ; i++) {
-                                                       reql = bo_getblk(si_oc(si), (char *)&msg_head[i], sizeof(char), totl);
+                                                       reql = co_getblk(si_oc(si), (char *)&msg_head[i], sizeof(char), totl);
                                                        if (reql <= 0) /* closed */
                                                                goto incomplete;
 
@@ -934,7 +934,7 @@ switchstate:
                                                        goto switchstate;
                                                }
 
-                                               reql = bo_getblk(si_oc(si), trash.str, msg_len, totl);
+                                               reql = co_getblk(si_oc(si), trash.str, msg_len, totl);
                                                if (reql <= 0) /* closed */
                                                        goto incomplete;
                                                totl += reql;
@@ -1332,12 +1332,12 @@ switchstate:
 
 ignore_msg:
                                /* skip consumed message */
-                               bo_skip(si_oc(si), totl);
+                               co_skip(si_oc(si), totl);
                                /* loop on that state to peek next message */
                                goto switchstate;
 
 incomplete:
-                               /* we get here when a bo_getblk() returns <= 0 in reql */
+                               /* we get here when a co_getblk() returns <= 0 in reql */
 
                                if (reql < 0) {
                                        /* there was an error */
@@ -1359,7 +1359,7 @@ incomplete:
                                        msg[1] = PEER_MSG_CTRL_RESYNCREQ;
 
                                        /* message to buffer */
-                                       repl = bi_putblk(si_ic(si), (char *)msg, sizeof(msg));
+                                       repl = ci_putblk(si_ic(si), (char *)msg, sizeof(msg));
                                         if (repl <= 0) {
                                                 /* no more write possible */
                                                 if (repl == -1)
@@ -1397,7 +1397,7 @@ incomplete:
                                                        }
 
                                                        /* message to buffer */
-                                                       repl = bi_putblk(si_ic(si), trash.str, msglen);
+                                                       repl = ci_putblk(si_ic(si), trash.str, msglen);
                                                        if (repl <= 0) {
                                                                /* no more write possible */
                                                                if (repl == -1) {
@@ -1426,7 +1426,7 @@ incomplete:
                                                                        }
 
                                                                        /* message to buffer */
-                                                                       repl = bi_putblk(si_ic(si), trash.str, msglen);
+                                                                       repl = ci_putblk(si_ic(si), trash.str, msglen);
                                                                        if (repl <= 0) {
                                                                                /* no more write possible */
                                                                                if (repl == -1) {
@@ -1468,7 +1468,7 @@ incomplete:
                                                                        }
 
                                                                        /* message to buffer */
-                                                                       repl = bi_putblk(si_ic(si), trash.str, msglen);
+                                                                       repl = ci_putblk(si_ic(si), trash.str, msglen);
                                                                        if (repl <= 0) {
                                                                                /* no more write possible */
                                                                                if (repl == -1) {
@@ -1503,7 +1503,7 @@ incomplete:
                                                                        }
 
                                                                        /* message to buffer */
-                                                                       repl = bi_putblk(si_ic(si), trash.str, msglen);
+                                                                       repl = ci_putblk(si_ic(si), trash.str, msglen);
                                                                        if (repl <= 0) {
                                                                                /* no more write possible */
                                                                                if (repl == -1) {
@@ -1542,7 +1542,7 @@ incomplete:
                                                                        }
 
                                                                        /* message to buffer */
-                                                                       repl = bi_putblk(si_ic(si), trash.str, msglen);
+                                                                       repl = ci_putblk(si_ic(si), trash.str, msglen);
                                                                        if (repl <= 0) {
                                                                                /* no more write possible */
                                                                                if (repl == -1) {
@@ -1574,7 +1574,7 @@ incomplete:
                                                                        }
 
                                                                        /* message to buffer */
-                                                                       repl = bi_putblk(si_ic(si), trash.str, msglen);
+                                                                       repl = ci_putblk(si_ic(si), trash.str, msglen);
                                                                        if (repl <= 0) {
                                                                                /* no more write possible */
                                                                                if (repl == -1) {
@@ -1610,7 +1610,7 @@ incomplete:
                                                                        }
 
                                                                        /* message to buffer */
-                                                                       repl = bi_putblk(si_ic(si), trash.str, msglen);
+                                                                       repl = ci_putblk(si_ic(si), trash.str, msglen);
                                                                        if (repl <= 0) {
                                                                                /* no more write possible */
                                                                                if (repl == -1) {
@@ -1642,7 +1642,7 @@ incomplete:
                                        msg[0] = PEER_MSG_CLASS_CONTROL;
                                        msg[1] = ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FINISHED) ? PEER_MSG_CTRL_RESYNCFINISHED : PEER_MSG_CTRL_RESYNCPARTIAL;
                                        /* process final lesson message */
-                                       repl = bi_putblk(si_ic(si), (char *)msg, sizeof(msg));
+                                       repl = ci_putblk(si_ic(si), (char *)msg, sizeof(msg));
                                        if (repl <= 0) {
                                                /* no more write possible */
                                                if (repl == -1)
@@ -1663,7 +1663,7 @@ incomplete:
                                        msg[1] = PEER_MSG_CTRL_RESYNCCONFIRM;
 
                                        /* message to buffer */
-                                       repl = bi_putblk(si_ic(si), (char *)msg, sizeof(msg));
+                                       repl = ci_putblk(si_ic(si), (char *)msg, sizeof(msg));
                                        if (repl <= 0) {
                                                /* no more write possible */
                                                if (repl == -1)
@@ -1679,7 +1679,7 @@ incomplete:
                        }
                        case PEER_SESS_ST_EXIT:
                                repl = snprintf(trash.str, trash.size, "%d\n", appctx->st1);
-                               if (bi_putblk(si_ic(si), trash.str, repl) == -1)
+                               if (ci_putblk(si_ic(si), trash.str, repl) == -1)
                                        goto full;
                                appctx->st0 = PEER_SESS_ST_END;
                                goto switchstate;
@@ -1689,7 +1689,7 @@ incomplete:
                                msg[0] = PEER_MSG_CLASS_ERROR;
                                msg[1] = PEER_MSG_ERR_SIZELIMIT;
 
-                               if (bi_putblk(si_ic(si), (char *)msg, sizeof(msg)) == -1)
+                               if (ci_putblk(si_ic(si), (char *)msg, sizeof(msg)) == -1)
                                        goto full;
                                appctx->st0 = PEER_SESS_ST_END;
                                goto switchstate;
@@ -1700,7 +1700,7 @@ incomplete:
                                msg[0] = PEER_MSG_CLASS_ERROR;
                                msg[1] = PEER_MSG_ERR_PROTOCOL;
 
-                               if (bi_putblk(si_ic(si), (char *)msg, sizeof(msg)) == -1)
+                               if (ci_putblk(si_ic(si), (char *)msg, sizeof(msg)) == -1)
                                        goto full;
                                appctx->st0 = PEER_SESS_ST_END;
                                /* fall through */
index e6107ee23378f288e5dbf2bf33649b8de905d43f..c83e9428b51d3d678152d3a53deb0d3db51ed455 100644 (file)
@@ -1051,7 +1051,7 @@ static void http_server_error(struct stream *s, struct stream_interface *si,
        channel_auto_close(si_ic(si));
        channel_auto_read(si_ic(si));
        if (msg)
-               bo_inject(si_ic(si), msg->str, msg->len);
+               co_inject(si_ic(si), msg->str, msg->len);
        if (!(s->flags & SF_ERR_MASK))
                s->flags |= err;
        if (!(s->flags & SF_FINST_MASK))
@@ -4225,7 +4225,7 @@ static int http_apply_redirect_rule(struct redirect_rule *rule, struct stream *s
                memcpy(chunk->str + chunk->len, "\r\n\r\n", 4);
                chunk->len += 4;
                FLT_STRM_CB(s, flt_http_reply(s, txn->status, chunk));
-               bo_inject(res->chn, chunk->str, chunk->len);
+               co_inject(res->chn, chunk->str, chunk->len);
                /* "eat" the request */
                bi_fast_delete(req->chn->buf, req->sov);
                req->next -= req->sov;
@@ -4927,7 +4927,7 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit
                                /* Expect is allowed in 1.1, look for it */
                                if (http_find_header2("Expect", 6, req->buf->p, &txn->hdr_idx, &ctx) &&
                                    unlikely(ctx.vlen == 12 && strncasecmp(ctx.line+ctx.val, "100-continue", 12) == 0)) {
-                                       bo_inject(&s->res, http_100_chunk.str, http_100_chunk.len);
+                                       co_inject(&s->res, http_100_chunk.str, http_100_chunk.len);
                                        http_remove_header2(&txn->req, &txn->hdr_idx, &ctx);
                                }
                        }
@@ -13157,7 +13157,7 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
                             tm.tm_hour, tm.tm_min, tm.tm_sec, (int)(date.tv_usec/1000),
                             error_snapshot_id);
 
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        /* Socket buffer full. Let's try again later from the same point */
                        si_applet_cant_put(si);
                        return 0;
@@ -13247,7 +13247,7 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
                                     es->b_flags, es->b_out, es->b_tot,
                                     es->len, es->b_wrap, es->pos);
 
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                /* Socket buffer full. Let's try again later from the same point */
                                si_applet_cant_put(si);
                                return 0;
@@ -13260,7 +13260,7 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
                        /* the snapshot changed while we were dumping it */
                        chunk_appendf(&trash,
                                     "  WARNING! update detected on this snapshot, dump interrupted. Please re-check!\n");
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -13277,7 +13277,7 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
                        if (newptr == appctx->ctx.errors.ptr)
                                return 0;
 
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                /* Socket buffer full. Let's try again later from the same point */
                                si_applet_cant_put(si);
                                return 0;
index ec1f60a9e09d03a8215ab784d260fe5eafb3afdf..52a17c2ad5fed1b42267782674c861b675173a6e 100644 (file)
@@ -1467,7 +1467,7 @@ static int dump_servers_state(struct stream_interface *si, struct chunk *buf)
                                srv->cur_state, srv->cur_admin, srv->uweight, srv->iweight, (long int)srv_time_since_last_change,
                                srv->check.status, srv->check.result, srv->check.health, srv->check.state, srv->agent.state,
                                bk_f_forced_id, srv_f_forced_id, srv->hostname ? srv->hostname : "-", srv->svc_port);
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -1495,7 +1495,7 @@ static int cli_io_handler_servers_state(struct appctx *appctx)
 
        if (appctx->st2 == STAT_ST_HEAD) {
                chunk_printf(&trash, "%d\n# %s\n", SRV_STATE_FILE_VERSION, SRV_STATE_FILE_FIELD_NAMES);
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -1531,7 +1531,7 @@ static int cli_io_handler_show_backend(struct appctx *appctx)
 
        if (!appctx->ctx.cli.p0) {
                chunk_printf(&trash, "# name\n");
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -1550,7 +1550,7 @@ static int cli_io_handler_show_backend(struct appctx *appctx)
                        continue;
 
                chunk_appendf(&trash, "%s\n", curproxy->id);
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
index 65c2c149f14c1749a6413facc8838c9d625568a2..b937c1972f6a50637c6c36729e63c06319598310 100644 (file)
@@ -4232,7 +4232,7 @@ static int cli_parse_get_weight(char **args, struct appctx *appctx, void *privat
 
        /* return server's effective weight at the moment */
        snprintf(trash.str, trash.size, "%d (initial %d)\n", sv->uweight, sv->iweight);
-       if (bi_putstr(si_ic(si), trash.str) == -1) {
+       if (ci_putstr(si_ic(si), trash.str) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
index 1d00b42e4ae01f0da491c4b61b2369f4323ee87d..6096f4608ad935ba086cd903d767d2410ae447bd 100644 (file)
@@ -7718,7 +7718,7 @@ static int cli_io_handler_tlskeys_files(struct appctx *appctx) {
                else
                        chunk_appendf(&trash, "# id (file)\n");
 
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -7758,7 +7758,7 @@ static int cli_io_handler_tlskeys_files(struct appctx *appctx) {
                                                           sizeof(struct tls_sess_key), t2->str, t2->size);
                                        chunk_appendf(&trash, "%d.%d %s\n", ref->unique_id, appctx->ctx.cli.i1, t2->str);
 
-                                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                                /* let's try again later from this stream. We add ourselves into
                                                 * this stream's users so that it can remove us upon termination.
                                                 */
@@ -7769,7 +7769,7 @@ static int cli_io_handler_tlskeys_files(struct appctx *appctx) {
                                }
                                appctx->ctx.cli.i1 = 0;
                        }
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
index 25d6e65ff826c166a53bea7193ad2d2071057340..614350d5628bb87559404fef3daaef8a656e6b81 100644 (file)
@@ -2008,7 +2008,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
        case STAT_PX_ST_TH:
                if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
                        stats_dump_html_px_hdr(si, px, uri);
-                       if (bi_putchk(rep, &trash) == -1) {
+                       if (ci_putchk(rep, &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -2020,7 +2020,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
        case STAT_PX_ST_FE:
                /* print the frontend */
                if (stats_dump_fe_stats(si, px)) {
-                       if (bi_putchk(rep, &trash) == -1) {
+                       if (ci_putchk(rep, &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -2052,7 +2052,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
 
                        /* print the frontend */
                        if (stats_dump_li_stats(si, px, l, flags)) {
-                               if (bi_putchk(rep, &trash) == -1) {
+                               if (ci_putchk(rep, &trash) == -1) {
                                        si_applet_cant_put(si);
                                        return 0;
                                }
@@ -2096,7 +2096,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
                        }
 
                        if (stats_dump_sv_stats(si, px, flags, sv)) {
-                               if (bi_putchk(rep, &trash) == -1) {
+                               if (ci_putchk(rep, &trash) == -1) {
                                        si_applet_cant_put(si);
                                        return 0;
                                }
@@ -2109,7 +2109,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
        case STAT_PX_ST_BE:
                /* print the backend */
                if (stats_dump_be_stats(si, px, flags)) {
-                       if (bi_putchk(rep, &trash) == -1) {
+                       if (ci_putchk(rep, &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -2121,7 +2121,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
        case STAT_PX_ST_END:
                if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
                        stats_dump_html_px_end(si, px);
-                       if (bi_putchk(rep, &trash) == -1) {
+                       if (ci_putchk(rep, &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -2533,7 +2533,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
                else if (!(appctx->ctx.stats.flags & STAT_FMT_TYPED))
                        stats_dump_csv_header();
 
-               if (bi_putchk(rep, &trash) == -1) {
+               if (ci_putchk(rep, &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -2544,7 +2544,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
        case STAT_ST_INFO:
                if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
                        stats_dump_html_info(si, uri);
-                       if (bi_putchk(rep, &trash) == -1) {
+                       if (ci_putchk(rep, &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -2583,7 +2583,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
                                stats_dump_html_end();
                        else
                                stats_dump_json_end();
-                       if (bi_putchk(rep, &trash) == -1) {
+                       if (ci_putchk(rep, &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
@@ -2636,7 +2636,7 @@ static int stats_process_http_post(struct stream_interface *si)
                goto out;
        }
 
-       reql = bo_getblk(si_oc(si), temp->str, s->txn->req.body_len, s->txn->req.eoh + 2);
+       reql = co_getblk(si_oc(si), temp->str, s->txn->req.body_len, s->txn->req.eoh + 2);
        if (reql <= 0) {
                /* we need more data */
                appctx->ctx.stats.st_code = STAT_STATUS_NONE;
@@ -2953,7 +2953,7 @@ static int stats_send_http_headers(struct stream_interface *si)
        s->txn->status = 200;
        s->logs.tv_request = now;
 
-       if (bi_putchk(si_ic(si), &trash) == -1) {
+       if (ci_putchk(si_ic(si), &trash) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
@@ -3001,7 +3001,7 @@ static int stats_send_http_redirect(struct stream_interface *si)
        s->txn->status = 303;
        s->logs.tv_request = now;
 
-       if (bi_putchk(si_ic(si), &trash) == -1) {
+       if (ci_putchk(si_ic(si), &trash) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
@@ -3060,7 +3060,7 @@ static void http_stats_io_handler(struct appctx *appctx)
                        last_fwd = si_ic(si)->to_forward;
                        si_ic(si)->to_forward = 0;
                        chunk_printf(&trash, "\r\n000000\r\n");
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                si_applet_cant_put(si);
                                si_ic(si)->to_forward = last_fwd;
                                goto out;
@@ -3086,7 +3086,7 @@ static void http_stats_io_handler(struct appctx *appctx)
 
                        if (last_len != data_len) {
                                chunk_printf(&trash, "\r\n%06x\r\n", (last_len - data_len));
-                               if (bi_putchk(si_ic(si), &trash) == -1)
+                               if (ci_putchk(si_ic(si), &trash) == -1)
                                        si_applet_cant_put(si);
 
                                si_ic(si)->total += (last_len - data_len);
@@ -3112,13 +3112,13 @@ static void http_stats_io_handler(struct appctx *appctx)
        if (appctx->st0 == STAT_HTTP_DONE) {
                if (appctx->ctx.stats.flags & STAT_CHUNKED) {
                        chunk_printf(&trash, "\r\n0\r\n\r\n");
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                si_applet_cant_put(si);
                                goto out;
                        }
                }
                /* eat the whole request */
-               bo_skip(si_oc(si), si_ob(si)->o);
+               co_skip(si_oc(si), si_ob(si)->o);
                res->flags |= CF_READ_NULL;
                si_shutr(si);
        }
@@ -3290,7 +3290,7 @@ static int stats_dump_info_to_buffer(struct stream_interface *si)
        else
                stats_dump_info_fields(&trash, info);
 
-       if (bi_putchk(si_ic(si), &trash) == -1) {
+       if (ci_putchk(si_ic(si), &trash) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
@@ -3518,7 +3518,7 @@ static int stats_dump_json_schema_to_buffer(struct stream_interface *si)
 
        stats_dump_json_schema(&trash);
 
-       if (bi_putchk(si_ic(si), &trash) == -1) {
+       if (ci_putchk(si_ic(si), &trash) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
index 0caa075347fd2305a66cfa5bbc5ab08971f30ec6..d95c77f745da469e81f669a3c038f76b1da9ce52 100644 (file)
@@ -2256,7 +2256,7 @@ static int table_dump_head_to_buffer(struct chunk *msg, struct stream_interface
        if (target && (strm_li(s)->bind_conf->level & ACCESS_LVL_MASK) < ACCESS_LVL_OPER)
                chunk_appendf(msg, "# contents not dumped due to insufficient privileges\n");
 
-       if (bi_putchk(si_ic(si), msg) == -1) {
+       if (ci_putchk(si_ic(si), msg) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
@@ -2329,7 +2329,7 @@ static int table_dump_entry_to_buffer(struct chunk *msg, struct stream_interface
        }
        chunk_appendf(msg, "\n");
 
-       if (bi_putchk(si_ic(si), msg) == -1) {
+       if (ci_putchk(si_ic(si), msg) == -1) {
                si_applet_cant_put(si);
                return 0;
        }
index 8c8084c5a5a91e30126b6eb9ecc1ee58f76a9bc7..fe01639d23e0c54a50411bf9d5882c411e7d0042 100644 (file)
@@ -2662,7 +2662,7 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
        if (appctx->ctx.sess.section > 0 && appctx->ctx.sess.uid != strm->uniq_id) {
                /* stream changed, no need to go any further */
                chunk_appendf(&trash, "  *** session terminated while we were watching it ***\n");
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -2945,7 +2945,7 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                             strm->txn ? strm->txn->rsp.next : 0, strm->res.buf->i,
                             strm->res.buf->size);
 
-               if (bi_putchk(si_ic(si), &trash) == -1) {
+               if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_applet_cant_put(si);
                        return 0;
                }
@@ -3156,7 +3156,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
 
                        chunk_appendf(&trash, "\n");
 
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
@@ -3176,7 +3176,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
                        else
                                chunk_appendf(&trash, "Session not found.\n");
 
-                       if (bi_putchk(si_ic(si), &trash) == -1) {
+                       if (ci_putchk(si_ic(si), &trash) == -1) {
                                si_applet_cant_put(si);
                                return 0;
                        }
index a5bd3edf165447ae64e30f3f4d8b50890e872688..eaf4e4594f8fbaa885918ef0334140b949f185de 100644 (file)
@@ -143,7 +143,7 @@ void stream_int_retnclose(struct stream_interface *si, const struct chunk *msg)
        channel_truncate(oc);
 
        if (likely(msg && msg->len))
-               bo_inject(oc, msg->str, msg->len);
+               co_inject(oc, msg->str, msg->len);
 
        oc->wex = tick_add_ifset(now_ms, oc->wto);
        channel_auto_read(oc);