]> git.kaiwu.me - haproxy.git/commit
MEDIUM: connection: remove useless flag CO_FL_DATA_WR_SH
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Aug 2017 07:59:52 +0000 (09:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Aug 2017 08:05:49 +0000 (10:05 +0200)
commitbbae3f017060e2890104588000d91bcdc6c4ef2d
treecab0cca32483940298d419b2cb2a5d02e3eb6151
parentcde5651c4d03c718f3036a69ef51b8384f2b93ba
MEDIUM: connection: remove useless flag CO_FL_DATA_WR_SH

After careful inspection, this flag is set at exactly two places :
  - once in the health-check receive callback after receipt of a
    response
  - once in the stream interface's shutw() code where CF_SHUTW is
    always set on chn->flags

The flag was checked in the checks before deciding to send data, but
when it is set, the wake() callback immediately closes the connection
so the CO_FL_SOCK_WR_SH flag is also set.

The flag was also checked in si_conn_send(), but checking the channel's
flag instead is enough and even reveals that one check involving it
could never match.

So it's time to remove this flag and replace its check with a check of
CF_SHUTW in the stream interface. This way each layer is responsible
for its shutdown, this will ease insertion of the mux layer.
contrib/debug/flags.c
include/proto/connection.h
include/types/connection.h
src/checks.c
src/stream_interface.c