]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MAJOR] buffers: fix misuse of the BF_SHUTW_NOW flag
authorWilly Tarreau <w@1wt.eu>
Sun, 6 Sep 2009 19:37:23 +0000 (21:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 19 Sep 2009 12:53:46 +0000 (14:53 +0200)
commit418fd4722a179b5e74892a9c547386c35171ab67
treef2410a6fe8d342151ace22f94c7a3c23fe7fdeb8
parent106f979bbd75c2160c038fca6b1bd2b0cfab3018
[MAJOR] buffers: fix misuse of the BF_SHUTW_NOW flag

This flag was incorrectly used as meaning "close immediately",
while it needs to say "close ASAP". ASAP here means when unsent
data pending in the buffer are sent. This helps cleaning up some
dirty tricks where the buffer output was checking the BF_SHUTR
flag combined with EMPTY and other such things. Now we have a
clearly defined semantics :

  - producer sets SHUTR and *may* set SHUTW_NOW if WRITE_ENA is
    set, otherwise leave it to the session processor to set it.
  - consumer only checks SHUTW_NOW to decide whether or not to
    call shutw().

This also induced very minor changes at some locations which were
not protected against buffer changes while the SHUTW_NOW flag was
set. Now we prevent send_max from changing when the flag is set.

Several tests have been run without any unexpected behaviour detected.

Some more cleanups are needed, as it clearly appears that some tests
could be removed with stricter semantics.
include/types/buffers.h
src/session.c
src/stream_sock.c