MINOR: connection: move the CO_FL_WAIT_ROOM cleanup to the reader only
authorWilly Tarreau <w@1wt.eu>
Fri, 17 Jan 2020 08:59:40 +0000 (09:59 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Jul 2020 12:45:24 +0000 (14:45 +0200)
commit812e6d04d98ee25d4794241064ecdde5179f0b3c
tree2cc2225c9e3487a04dd0efe3e02bf3a014f2958f
parenta1dde23e936adb66f6eaba33fc5bf93278b8efbd
MINOR: connection: move the CO_FL_WAIT_ROOM cleanup to the reader only

CO_FL_WAIT_ROOM is set by the splicing function in raw_sock, and cleared
by the stream-int when splicing is disabled, as well as in
conn_refresh_polling_flags() so that a new call to ->rcv_pipe() could
be attempted by the I/O callbacks called from conn_fd_handler(). This
clearing in conn_refresh_polling_flags() makes no sense anymore and is
in no way related to the polling at all.

Since we don't call them from there anymore it's better to clear it
before attempting to receive, and to set it again later. So let's move
this operation where it should be, in raw_sock_to_pipe() so that it's
now symmetric. It was also placed in raw_sock_to_buf() so that we're
certain that it gets cleared if an attempt to splice is replaced with
a subsequent attempt to recv(). And these were currently already achieved
by the call to conn_refresh_polling_flags(). Now it could theorically be
removed from the stream-int.

(cherry picked from commit e2a0eeca778115adc2e6dd7c89bb36181f349ca1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

[Cf: This patch is mandatory in the 2.1 to remove the flag CO_FL_WAIT_ROOM
     because it is not removed after a successfull send.]
include/proto/connection.h
src/raw_sock.c