]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stconn: Check room needed to unblock opposite SC when data was sent
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 May 2023 09:40:30 +0000 (11:40 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 May 2023 13:44:23 +0000 (15:44 +0200)
After a sending attempt, we check the opposite SC to see if it is waiting
for a minimum free space to receive more data. If the condition is
respected, it is unblocked. 0 is special case where the SC is
unconditionally unblocked.

src/stconn.c

index 4290961d1f20a65b8147a834a223bc77d57415da..39dcbb5f0cea022d6d7075378fbaaef8790e0648 100644 (file)
@@ -1664,9 +1664,11 @@ static int sc_conn_send(struct stconn *sc)
                oc->flags |= CF_WRITE_EVENT | CF_WROTE_DATA;
                if (sc->state == SC_ST_CON)
                        sc->state = SC_ST_RDY;
-               sc_have_room(sc_opposite(sc));
        }
 
+       if (!sco->room_needed || (did_send && (sco->room_needed < 0 || channel_recv_max(sc_oc(sc)) >= sco->room_needed)))
+               sc_have_room(sco);
+
        if (sc_ep_test(sc, SE_FL_ERROR | SE_FL_ERR_PENDING)) {
                oc->flags |= CF_WRITE_EVENT;
                BUG_ON(sc_ep_test(sc, SE_FL_EOS|SE_FL_ERROR|SE_FL_ERR_PENDING) == (SE_FL_EOS|SE_FL_ERR_PENDING));