BUG/MINOR: stream-int: make sure not to go through the rcv_buf path after splice()

When splice() reports a pipe full condition, we go through the common
code used to release a possibly empty pipe (which we don't have) and which
immediately tries to allocate a buffer that will never be used. Further,
it may even subscribe to get this buffer if the resources are low. Let's
simply get out of this way if the pipe is full.

This fix could be backported to 1.8 though the code is a bit different
overthere.
This commit is contained in:
Willy Tarreau 2018-11-15 16:06:02 +01:00
parent 81464b4e4d
commit ffb1205a47

View File

@ -1196,6 +1196,7 @@ int si_cs_recv(struct conn_stream *cs)
* could soon be full. Let's stop before needing to poll.
*/
si_cant_put(si);
goto done_recv;
}
/* splice not possible (anymore), let's go on on standard copy */
@ -1290,6 +1291,7 @@ int si_cs_recv(struct conn_stream *cs)
break;
} /* while !flags */
done_recv:
if (cur_read) {
if ((ic->flags & (CF_STREAMER | CF_STREAMER_FAST)) &&
(cur_read <= ic->buf.size / 2)) {