]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: make si_sync_recv() simply check ENDP before si_cs_recv()
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Nov 2018 13:26:11 +0000 (14:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Nov 2018 20:41:48 +0000 (21:41 +0100)
Instead of checking complex conditions to call si_cs_recv() upon first
call, let's simply use si_rx_endp_ready() now that si_cs_recv() reports
it accurately, and add si_rx_blocked() to cover any blocking situation.

include/proto/stream_interface.h

index 92cfe4dcddb09a7d087f80f0f5231d5b8ec2fbcc..c726f87fa81ece6c072ecb5e604e7f45b4f4d7d8 100644 (file)
@@ -443,7 +443,7 @@ static inline int si_sync_recv(struct stream_interface *si)
        if (si->wait_event.wait_reason & SUB_CAN_RECV)
                return 0; // already subscribed
 
-       if (si->flags & SI_FL_RXBLK_ROOM && c_size(si_ic(si)))
+       if (!si_rx_endp_ready(si) || si_rx_blocked(si))
                return 0; // already failed
 
        return si_cs_recv(cs);