From: Olivier Houchard Date: Tue, 4 Dec 2018 14:46:16 +0000 (+0100) Subject: BUG/MEDIUM: stream_interface: Make REALLY sure we read all the data. X-Git-Tag: v1.9-dev10~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c490efd625921f3fe71c591a54170b99c4db2f76;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stream_interface: Make REALLY sure we read all the data. In si_cs_recv(), try inconditionally to recv as long as the CS_FL_RCV_MORE is set on the conn_stream, or we will miss some data. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 9cbfab13e7..3a5a39f23c 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1203,8 +1203,9 @@ int si_cs_recv(struct conn_stream *cs) * that if such an event is not handled above in splice, it will be handled here by * recv(). */ - while (!(conn->flags & (CO_FL_ERROR | CO_FL_WAIT_ROOM | CO_FL_HANDSHAKE)) && - (!(cs->flags & (CS_FL_ERROR|CS_FL_EOS)) || (cs->flags & CS_FL_RCV_MORE)) && !(ic->flags & CF_SHUTR)) { + while ((cs->flags & CS_FL_RCV_MORE) || + (!(conn->flags & (CO_FL_ERROR | CO_FL_WAIT_ROOM | CO_FL_HANDSHAKE)) && + (!(cs->flags & (CS_FL_ERROR|CS_FL_EOS))) && !(ic->flags & CF_SHUTR))) { /* may be null. This is the mux responsibility to set * CS_FL_RCV_MORE on the CS if more space is needed. */