]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: replace si_cant_put() with si_rx_room_{blk,rdy}()
authorWilly Tarreau <w@1wt.eu>
Thu, 15 Nov 2018 10:08:52 +0000 (11:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Nov 2018 20:41:50 +0000 (21:41 +0100)
Remaining calls to si_cant_put() were all for lack of room and were
turned to si_rx_room_blk(). A few places where SI_FL_RXBLK_ROOM was
cleared by hand were converted to si_rx_room_rdy().

The now unused si_cant_put() function was removed.

17 files changed:
include/proto/stream_interface.h
src/cache.c
src/cli.c
src/dns.c
src/flt_spoe.c
src/hlua.c
src/log.c
src/map.c
src/memory.c
src/peers.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 d1c022c263fb2a2869c516711ae4c990616af73f..90e395655c077ebdb67f3ce2aebe56c649d4229a 100644 (file)
@@ -259,13 +259,6 @@ static inline int si_rx_endp_ready(const struct stream_interface *si)
        return !(si->flags & SI_FL_RX_WAIT_EP);
 }
 
-/* Report that a stream interface failed to put some data into the input buffer */
-static inline void si_cant_put(struct stream_interface *si)
-{
-       si->flags |=  SI_FL_RXBLK_ROOM;
-       si->flags &= ~SI_FL_RX_WAIT_EP;
-}
-
 /* The stream interface announces it is ready to try to deliver more data to the input buffer */
 static inline void si_rx_endp_more(struct stream_interface *si)
 {
@@ -306,6 +299,22 @@ static inline void si_rx_buff_blk(struct stream_interface *si)
        si->flags |=  SI_FL_RXBLK_BUFF;
 }
 
+/* Tell a stream interface some room was made in the input buffer */
+static inline void si_rx_room_rdy(struct stream_interface *si)
+{
+       si->flags &= ~SI_FL_RXBLK_ROOM;
+}
+
+/* The stream interface announces it failed to put data into the input buffer
+ * by lack of room. Since it indicates a willingness to deliver data to the
+ * buffer that will have to be retried, we automatically clear RXBLK_ENDP to
+ * be called again as soon as RXBLK_ROOM is cleared.
+ */
+static inline void si_rx_room_blk(struct stream_interface *si)
+{
+       si->flags |=  SI_FL_RXBLK_ROOM;
+}
+
 /* The stream interface announces it will never put new data into the input
  * buffer and that it's not waiting for its endpoint to deliver anything else.
  * This function obviously doesn't have a _rdy equivalent.
index fdb0f256f6bcdf25264d76f92d3e97cd73273edb..9b77121b0afa6d5dd148b03641ef22d4ccecd15b 100644 (file)
@@ -617,7 +617,7 @@ static int cache_channel_row_data_get(struct appctx *appctx, int len)
                        offset = 0;
                if (ret <= 0) {
                        if (ret == -3 || ret == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                break;
                        }
                        return -1;
@@ -1142,7 +1142,7 @@ static int cli_io_handler_show_cache(struct appctx *appctx)
                if (!next_key) {
                        chunk_printf(&trash, "%p: %s (shctx:%p, available blocks:%d)\n", cache, cache->id, shctx_ptr(cache), shctx_ptr(cache)->nbav);
                        if (ci_putchk(si_ic(si), &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
@@ -1168,7 +1168,7 @@ static int cli_io_handler_show_cache(struct appctx *appctx)
                        shctx_unlock(shctx_ptr(cache));
 
                        if (ci_putchk(si_ic(si), &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
index 6329db1ce335c57e6abd8f26f551db1d4e87ca89..199d25fcf99d8de90359ad009731bca278b8c65c 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -590,7 +590,7 @@ static void cli_io_handler(struct appctx *appctx)
                         * would want to return some info right after parsing.
                         */
                        if (buffer_almost_full(si_ib(si))) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                break;
                        }
 
@@ -693,7 +693,7 @@ static void cli_io_handler(struct appctx *appctx)
                                                        cli_get_severity_output(appctx)) != -1)
                                        appctx->st0 = CLI_ST_PROMPT;
                                else
-                                       si_cant_put(si);
+                                       si_rx_room_blk(si);
                                break;
                        case CLI_ST_PRINT_FREE: {
                                const char *msg = appctx->ctx.cli.err;
@@ -706,7 +706,7 @@ static void cli_io_handler(struct appctx *appctx)
                                        appctx->st0 = CLI_ST_PROMPT;
                                }
                                else
-                                       si_cant_put(si);
+                                       si_rx_room_blk(si);
                                break;
                        }
                        case CLI_ST_CALLBACK: /* use custom pointer */
@@ -746,7 +746,7 @@ static void cli_io_handler(struct appctx *appctx)
                                if (ci_putstr(si_ic(si), prompt) != -1)
                                        appctx->st0 = CLI_ST_GETREQ;
                                else
-                                       si_cant_put(si);
+                                       si_rx_room_blk(si);
                        }
 
                        /* If the output functions are still there, it means they require more room. */
@@ -834,7 +834,7 @@ static int cli_io_handler_show_env(struct appctx *appctx)
                chunk_printf(&trash, "%s\n", *var);
 
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
                if (appctx->st2 == STAT_ST_END)
@@ -951,7 +951,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
                chunk_appendf(&trash, "\n");
 
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
        skip:
@@ -1008,7 +1008,7 @@ static int cli_io_handler_show_activity(struct appctx *appctx)
        if (ci_putchk(si_ic(si), &trash) == -1) {
                chunk_reset(&trash);
                chunk_printf(&trash, "[output too large, cannot dump]\n");
-               si_cant_put(si);
+               si_rx_room_blk(si);
        }
 
        /* dump complete */
@@ -1030,7 +1030,7 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
                case STAT_ST_INIT:
                        chunk_printf(&trash, "# socket lvl processes\n");
                        if (ci_putchk(si_ic(si), &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                        appctx->st2 = STAT_ST_LIST;
@@ -1099,7 +1099,7 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
                                                }
 
                                                if (ci_putchk(si_ic(si), &trash) == -1) {
-                                                       si_cant_put(si);
+                                                       si_rx_room_blk(si);
                                                        return 0;
                                                }
                                        }
@@ -1413,7 +1413,7 @@ static int cli_io_handler_show_proc(struct appctx *appctx)
        }
 
        if (ci_putchk(si_ic(si), &trash) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
 
index 4ceda4d1f31dd22e116fb999babc37ba86216b3e..57bec21dcbce38c2a74cf58d92ad1260152170b5 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -2030,7 +2030,7 @@ static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
                        /* let's try again later from this session. We add ourselves into
                         * this session's users so that it can remove us upon termination.
                         */
-                       si->flags |= SI_FL_RXBLK_ROOM;
+                       si_rx_room_blk(si);
                        return 0;
                }
                /* fall through */
index edb853a6623255881643c563482d15b83713d8a1..72e1773a5539c64e7ae0803a9bd00db23223042d 100644 (file)
@@ -1156,7 +1156,7 @@ spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz)
        ret = ci_putblk(si_ic(si), buf, framesz+4);
        if (ret <= 0) {
                if ((ret == -3 && b_is_null(&si_ic(si)->buf)) || ret == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 1; /* retry */
                }
                SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_IO;
index f7d2718869e35c18ff3c0cfec30a97d4a8f531bb..2364317745a9e378aebf8db94f68f36b1f7d7267 100644 (file)
@@ -3833,7 +3833,7 @@ __LJMP static int hlua_applet_tcp_send_yield(lua_State *L, int status, lua_KCont
         * applet, and returns a yield.
         */
        if (l < len) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_send_yield, TICK_ETERNITY, 0));
        }
 
@@ -4130,7 +4130,7 @@ __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_K
                 * If ret is -1, we dont have room in the buffer, so we yield.
                 */
                if (ret == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_getline_yield, TICK_ETERNITY, 0));
                }
                appctx->appctx->ctx.hlua_apphttp.flags &= ~APPLET_100C;
@@ -4216,7 +4216,7 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon
                 * If ret is -1, we dont have room in the buffer, so we yield.
                 */
                if (ret == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_recv_yield, TICK_ETERNITY, 0));
                }
                appctx->appctx->ctx.hlua_apphttp.flags &= ~APPLET_100C;
@@ -4328,7 +4328,7 @@ __LJMP static int hlua_applet_http_send_yield(lua_State *L, int status, lua_KCon
         * applet, and returns a yield.
         */
        if (l < len) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_send_yield, TICK_ETERNITY, 0));
        }
 
@@ -4468,7 +4468,7 @@ __LJMP static int hlua_applet_http_start_response_yield(lua_State *L, int status
 
        /* If ret is -1, we dont have room in the buffer, so we yield. */
        if (ret == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_start_response_yield, TICK_ETERNITY, 0));
        }
 
@@ -6775,7 +6775,7 @@ static void hlua_applet_http_fct(struct appctx *ctx)
 
                        /* no enough space error. */
                        if (ret == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return;
                        }
 
@@ -7224,7 +7224,7 @@ static int hlua_cli_io_handler_fct(struct appctx *appctx)
        case HLUA_E_AGAIN:
                /* We want write. */
                if (HLUA_IS_WAKERESWR(hlua))
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                /* Set the timeout. */
                if (hlua->wake_time != TICK_ETERNITY)
                        task_schedule(hlua->task, hlua->wake_time);
index 896219468688f991757e7ebf4524e70dfca91255..b6f99bc29268210a50df578ab9521a4a52b9dab9 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -2778,7 +2778,7 @@ static int cli_io_handler_show_startup_logs(struct appctx *appctx)
        const char *msg = (startup_logs ? startup_logs : "No startup alerts/warnings.\n");
 
        if (ci_putstr(si_ic(si), msg) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
        return 1;
index 859ad8907c492288d9398fed8f6a1835a11975a1..7eb9e3647ba15d9c2fcffe458b437b5e454be6e6 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -381,7 +381,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
                                 */
                                LIST_ADDQ(&elt->back_refs, &appctx->ctx.map.bref.users);
                                HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
 
@@ -410,7 +410,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
                chunk_reset(&trash);
                chunk_appendf(&trash, "# id (file) description\n");
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
 
@@ -440,7 +440,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
 
@@ -561,7 +561,7 @@ static int cli_io_handler_map_lookup(struct appctx *appctx)
                                 * this stream's users so that it can remove us upon termination.
                                 */
                                HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
 
index ced9af5506f0330148218612dcc81f263f52885a..17ac1d1f35b2f35be126f0ad41c3ffb118d2f275 100644 (file)
@@ -514,7 +514,7 @@ static int cli_io_handler_dump_pools(struct appctx *appctx)
 
        dump_pools_to_trash();
        if (ci_putchk(si_ic(si), &trash) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
        return 1;
index 649af83ffe1a055a55d651269e0606c01e8b1a7e..76ecf68bf67d7f44825a40b51c55dc2e43ff04c2 100644 (file)
@@ -1892,7 +1892,7 @@ out:
                HA_SPIN_UNLOCK(PEER_LOCK, &curpeer->lock);
        return;
 full:
-       si_cant_put(si);
+       si_rx_room_blk(si);
        goto out;
 }
 
index 763b95de3c6d6a0213d880942e0051e22227f17f..d0b06d8eb1329a49a789ce7fa786e0ec51f6ca90 100644 (file)
@@ -1581,7 +1581,7 @@ static int dump_servers_state(struct stream_interface *si, struct buffer *buf)
                                bk_f_forced_id, srv_f_forced_id, srv->hostname ? srv->hostname : "-", srv->svc_port,
                                srvrecord ? srvrecord : "-");
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
        }
@@ -1608,7 +1608,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 (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
                appctx->st2 = STAT_ST_INFO;
@@ -1643,7 +1643,7 @@ static int cli_io_handler_show_backend(struct appctx *appctx)
        if (!appctx->ctx.cli.p0) {
                chunk_printf(&trash, "# name\n");
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
                appctx->ctx.cli.p0 = proxies_list;
@@ -1662,7 +1662,7 @@ static int cli_io_handler_show_backend(struct appctx *appctx)
 
                chunk_appendf(&trash, "%s\n", curproxy->id);
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
        }
@@ -2155,7 +2155,7 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
  cant_send_unlock:
        HA_SPIN_UNLOCK(PROXY_LOCK, &appctx->ctx.errors.px->lock);
  cant_send:
-       si_cant_put(si);
+       si_rx_room_blk(si);
        return 0;
 }
 
index 47eaee6a9636fc4fb308d84c72d4640afb8f15ed..5a539ef9d8f49caea88b9d9742a39fab8b947b0a 100644 (file)
@@ -4460,7 +4460,7 @@ static int cli_parse_get_weight(char **args, char *payload, struct appctx *appct
        snprintf(trash.area, trash.size, "%d (initial %d)\n", sv->uweight,
                 sv->iweight);
        if (ci_putstr(si_ic(si), trash.area) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
        return 1;
index 39d599cfd8e0b518b385bae5536136418de240f5..5b68ece2c5ccd1d761e741c10f8346ab5674e88a 100644 (file)
@@ -8571,7 +8571,7 @@ static int cli_io_handler_tlskeys_files(struct appctx *appctx) {
                        chunk_appendf(&trash, "# id (file)\n");
 
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
 
@@ -8620,7 +8620,7 @@ static int cli_io_handler_tlskeys_files(struct appctx *appctx) {
                                                 * this stream's users so that it can remove us upon termination.
                                                 */
                                                HA_RWLOCK_RDUNLOCK(TLSKEYS_REF_LOCK, &ref->lock);
-                                               si_cant_put(si);
+                                               si_rx_room_blk(si);
                                                return 0;
                                        }
                                        appctx->ctx.cli.i1++;
@@ -8632,7 +8632,7 @@ static int cli_io_handler_tlskeys_files(struct appctx *appctx) {
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
 
index 31c4f8540d425a0dfa4985efe85935414bd957ba..ec61c09d0cab9724923599bdacf0b8878aae0e17 100644 (file)
@@ -2034,7 +2034,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
                if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
                        stats_dump_html_px_hdr(si, px, uri);
                        if (ci_putchk(rep, &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
@@ -2046,7 +2046,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
                /* print the frontend */
                if (stats_dump_fe_stats(si, px)) {
                        if (ci_putchk(rep, &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
@@ -2059,7 +2059,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
                /* stats.l has been initialized above */
                for (; appctx->ctx.stats.l != &px->conf.listeners; appctx->ctx.stats.l = l->by_fe.n) {
                        if (buffer_almost_full(&rep->buf)) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
 
@@ -2078,7 +2078,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 (ci_putchk(rep, &trash) == -1) {
-                                       si_cant_put(si);
+                                       si_rx_room_blk(si);
                                        return 0;
                                }
                        }
@@ -2092,7 +2092,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
                /* stats.sv has been initialized above */
                for (; appctx->ctx.stats.sv != NULL; appctx->ctx.stats.sv = sv->next) {
                        if (buffer_almost_full(&rep->buf)) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
 
@@ -2122,7 +2122,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 (ci_putchk(rep, &trash) == -1) {
-                                       si_cant_put(si);
+                                       si_rx_room_blk(si);
                                        return 0;
                                }
                        }
@@ -2135,7 +2135,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
                /* print the backend */
                if (stats_dump_be_stats(si, px, flags)) {
                        if (ci_putchk(rep, &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
@@ -2147,7 +2147,7 @@ int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy *px, st
                if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
                        stats_dump_html_px_end(si, px);
                        if (ci_putchk(rep, &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
@@ -2559,7 +2559,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
                        stats_dump_csv_header();
 
                if (ci_putchk(rep, &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
 
@@ -2570,7 +2570,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
                if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
                        stats_dump_html_info(si, uri);
                        if (ci_putchk(rep, &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
@@ -2584,7 +2584,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
                /* dump proxies */
                while (appctx->ctx.stats.px) {
                        if (buffer_almost_full(&rep->buf)) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
 
@@ -2609,7 +2609,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
                        else
                                stats_dump_json_end();
                        if (ci_putchk(rep, &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                return 0;
                        }
                }
@@ -2979,7 +2979,7 @@ static int stats_send_http_headers(struct stream_interface *si)
                chunk_appendf(&trash, "\r\n");
 
        if (ci_putchk(si_ic(si), &trash) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
 
@@ -3024,7 +3024,7 @@ static int stats_send_http_redirect(struct stream_interface *si)
                     scope_txt);
 
        if (ci_putchk(si_ic(si), &trash) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
 
@@ -3085,7 +3085,7 @@ static void http_stats_io_handler(struct appctx *appctx)
                        si_ic(si)->to_forward = 0;
                        chunk_printf(&trash, "\r\n000000\r\n");
                        if (ci_putchk(si_ic(si), &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                si_ic(si)->to_forward = last_fwd;
                                goto out;
                        }
@@ -3111,7 +3111,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 (ci_putchk(si_ic(si), &trash) == -1)
-                                       si_cant_put(si);
+                                       si_rx_room_blk(si);
 
                                si_ic(si)->total += (last_len - data_len);
                                b_add(si_ib(si), last_len - data_len);
@@ -3137,7 +3137,7 @@ static void http_stats_io_handler(struct appctx *appctx)
                if (appctx->ctx.stats.flags & STAT_CHUNKED) {
                        chunk_printf(&trash, "\r\n0\r\n\r\n");
                        if (ci_putchk(si_ic(si), &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                goto out;
                        }
                }
@@ -3333,7 +3333,7 @@ static int stats_dump_info_to_buffer(struct stream_interface *si)
                stats_dump_info_fields(&trash, info);
 
        if (ci_putchk(si_ic(si), &trash) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
 
@@ -3561,7 +3561,7 @@ static int stats_dump_json_schema_to_buffer(struct stream_interface *si)
        stats_dump_json_schema(&trash);
 
        if (ci_putchk(si_ic(si), &trash) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
 
index 5e55b7a9b90ebf99348c70a3c4093c2dee964090..593b9893806f76b5fbae866d1479b9f559bb03af 100644 (file)
@@ -3049,7 +3049,7 @@ static int table_dump_head_to_buffer(struct buffer *msg,
                chunk_appendf(msg, "# contents not dumped due to insufficient privileges\n");
 
        if (ci_putchk(si_ic(si), msg) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
 
@@ -3123,7 +3123,7 @@ static int table_dump_entry_to_buffer(struct buffer *msg,
        chunk_appendf(msg, "\n");
 
        if (ci_putchk(si_ic(si), msg) == -1) {
-               si_cant_put(si);
+               si_rx_room_blk(si);
                return 0;
        }
 
index da528b26e3d171ee818d00464bda01bddfa9b211..f4473e86d0ccf97d613d6ea2a3808e98d30534d9 100644 (file)
@@ -2782,7 +2782,7 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                /* stream changed, no need to go any further */
                chunk_appendf(&trash, "  *** session terminated while we were watching it ***\n");
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
                appctx->ctx.sess.uid = 0;
@@ -3080,7 +3080,7 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                             (unsigned int)strm->res.buf.size);
 
                if (ci_putchk(si_ic(si), &trash) == -1) {
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        return 0;
                }
 
@@ -3299,7 +3299,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
                                /* let's try again later from this stream. We add ourselves into
                                 * this stream's users so that it can remove us upon termination.
                                 */
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                LIST_ADDQ(&curr_strm->back_refs, &appctx->ctx.sess.bref.users);
                                HA_SPIN_UNLOCK(STRMS_LOCK, &streams_lock);
                                return 0;
@@ -3317,7 +3317,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
                                chunk_appendf(&trash, "Session not found.\n");
 
                        if (ci_putchk(si_ic(si), &trash) == -1) {
-                               si_cant_put(si);
+                               si_rx_room_blk(si);
                                HA_SPIN_UNLOCK(STRMS_LOCK, &streams_lock);
                                return 0;
                        }
index c349aac2e26551ff879bb2ce7106a7b02882d524..f88b4323b30a98cc20fb3e92e3925bc0585405ad 100644 (file)
@@ -249,7 +249,7 @@ static void stream_int_chk_rcv(struct stream_interface *si)
 
        if (ic->pipe) {
                /* stop reading */
-               si->flags |= SI_FL_RXBLK_ROOM;
+               si_rx_room_blk(si);
        }
        else {
                /* (re)start reading */
@@ -482,7 +482,7 @@ void stream_int_notify(struct stream_interface *si)
 
        if ((sio->flags & SI_FL_RXBLK_ROOM) &&
            ((oc->flags & CF_WRITE_PARTIAL) || channel_is_empty(oc)))
-               sio->flags &= ~SI_FL_RXBLK_ROOM;
+               si_rx_room_rdy(sio);
 
        if (oc->flags & CF_DONT_READ)
                si_rx_chan_blk(sio);
@@ -519,7 +519,7 @@ void stream_int_notify(struct stream_interface *si)
                 * buffer or in the pipe.
                 */
                if (new_len < last_len)
-                       si->flags &= ~SI_FL_RXBLK_ROOM;
+                       si_rx_room_rdy(si);
        }
 
        if (!(ic->flags & CF_DONT_READ))
@@ -761,7 +761,7 @@ void stream_int_update(struct stream_interface *si)
 
                if (!channel_is_empty(ic)) {
                        /* stop reading, imposed by channel's policy or contents */
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                }
                else {
                        /* (re)start reading and update timeout. Note: we don't recompute the timeout
@@ -769,7 +769,7 @@ void stream_int_update(struct stream_interface *si)
                         * update it if is was not yet set. The stream socket handler will already
                         * have updated it if there has been a completed I/O.
                         */
-                       si->flags &= ~SI_FL_RXBLK_ROOM;
+                       si_rx_room_rdy(si);
                }
                if (si->flags & SI_FL_RXBLK_ANY & ~SI_FL_RX_WAIT_EP)
                        ic->rex = TICK_ETERNITY;
@@ -844,7 +844,7 @@ void si_update_both(struct stream_interface *si_f, struct stream_interface *si_b
            !(cs->flags & CS_FL_ERROR) &&
            !(cs->conn->flags & CO_FL_ERROR)) {
                if (si_cs_send(cs))
-                       si_b->flags &= ~SI_FL_RXBLK_ROOM;
+                       si_rx_room_rdy(si_b);
        }
 
        /* back stream-int */
@@ -856,7 +856,7 @@ void si_update_both(struct stream_interface *si_f, struct stream_interface *si_b
            !(cs->flags & CS_FL_ERROR) &&
            !(cs->conn->flags & CO_FL_ERROR)) {
                if (si_cs_send(cs))
-                       si_f->flags &= ~SI_FL_RXBLK_ROOM;
+                       si_rx_room_rdy(si_f);
        }
 
        /* let's recompute both sides states */
@@ -1205,7 +1205,7 @@ int si_cs_recv(struct conn_stream *cs)
                        /* the pipe is full or we have read enough data that it
                         * could soon be full. Let's stop before needing to poll.
                         */
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
                        goto done_recv;
                }
 
@@ -1240,7 +1240,7 @@ int si_cs_recv(struct conn_stream *cs)
 
                ret = cs->conn->mux->rcv_buf(cs, &ic->buf, max, co_data(ic) ? CO_RFL_BUF_WET : 0);
                if (cs->flags & CS_FL_RCV_MORE)
-                       si_cant_put(si);
+                       si_rx_room_blk(si);
 
                if (ret <= 0) {
                        break;