diff --git a/include/haproxy/channel-t.h b/include/haproxy/channel-t.h index 8feb62dd2..01a0a2488 100644 --- a/include/haproxy/channel-t.h +++ b/include/haproxy/channel-t.h @@ -52,7 +52,7 @@ */ #define CF_READ_NULL 0x00000001 /* last read detected on producer side */ -#define CF_READ_PARTIAL 0x00000002 /* some data were read from producer */ +#define CF_READ_PARTIAL 0x00000002 /* some data were read from producer or a read exception occurred */ #define CF_READ_TIMEOUT 0x00000004 /* timeout while waiting for producer */ #define CF_READ_ERROR 0x00000008 /* unrecoverable error on producer side */ #define CF_READ_ACTIVITY (CF_READ_NULL|CF_READ_PARTIAL|CF_READ_ERROR) diff --git a/src/stream_interface.c b/src/stream_interface.c index 68b89525e..e5da8ea56 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1351,8 +1351,13 @@ int si_cs_recv(struct conn_stream *cs) flags |= ((!conn_is_back(conn) && (si_strm(si)->be->options & PR_O_ABRT_CLOSE)) ? CO_RFL_KEEP_RECV : 0); ret = cs->conn->mux->rcv_buf(cs, &ic->buf, max, flags | (co_data(ic) ? CO_RFL_BUF_WET : 0)); - if (cs->flags & CS_FL_WANT_ROOM) + if (cs->flags & CS_FL_WANT_ROOM) { si_rx_room_blk(si); + /* Add READ_PARTIAL because some data are pending but + * cannot be xferred to the channel + */ + ic->flags |= CF_READ_PARTIAL; + } if (ret <= 0) { /* if we refrained from reading because we asked for a