MEDIUM: stream-int: fix the si_cant_put() calls used for buffer readiness
A number of calls to si_cant_put() were used in fact to request being
called back once a buffer is available. These ones are not needed anymore
since si_alloc_ibuf() already sets the SI_FL_RXBLK_BUFF flag when called
in appctx context. Those called with a foreign stream-int are simply turned
to si_rx_buff_blk().
diff --git a/src/cache.c b/src/cache.c
index 35568bc..fdb0f25 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -644,7 +644,9 @@
/* Check if the input buffer is avalaible. */
if (res->buf.size == 0) {
- si_cant_put(si);
+ /* buf.size==0 means we failed to get a buffer and were
+ * already subscribed to a wait list to get a buffer.
+ */
goto out;
}
diff --git a/src/cli.c b/src/cli.c
index 720a9b4..6329db1 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -550,7 +550,9 @@
/* Check if the input buffer is avalaible. */
if (res->buf.size == 0) {
- si_cant_put(si);
+ /* buf.size==0 means we failed to get a buffer and were
+ * already subscribed to a wait list to get a buffer.
+ */
goto out;
}
diff --git a/src/hlua.c b/src/hlua.c
index ad0f9f9..f7d2718 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2942,7 +2942,7 @@
* the request buffer if its not required.
*/
if (chn->buf.size == 0) {
- si_cant_put(chn_prod(chn));
+ si_rx_buff_blk(chn_prod(chn));
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_channel_append_yield, TICK_ETERNITY, 0));
}
@@ -3036,7 +3036,7 @@
* the request buffer if its not required.
*/
if (chn->buf.size == 0) {
- si_cant_put(chn_prod(chn));
+ si_rx_buff_blk(chn_prod(chn));
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_channel_send_yield, TICK_ETERNITY, 0));
}
diff --git a/src/stats.c b/src/stats.c
index 0574260..31c4f85 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -3049,7 +3049,9 @@
/* Check if the input buffer is avalaible. */
if (res->buf.size == 0) {
- si_cant_put(si);
+ /* already subscribed, we'll be called later once the buffer is
+ * available.
+ */
goto out;
}