From c490efd625921f3fe71c591a54170b99c4db2f76 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Tue, 4 Dec 2018 15:46:16 +0100 Subject: [PATCH] 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. --- src/stream_interface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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. */ -- 2.47.3