]> git.kaiwu.me - haproxy.git/commit
MEDIUM: h2: perform a graceful shutdown on "Connection: close"
authorWilly Tarreau <w@1wt.eu>
Mon, 30 Oct 2017 20:54:49 +0000 (21:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:16:19 +0000 (18:16 +0100)
commitaf1e4f5167062d5127a446e1bd63b4fd6185b7e6
tree51f8bd6333bf3f39072fce6b16efee542e5e7c49
parent1c661986a824251b4f6854c2e9facb4b723cff28
MEDIUM: h2: perform a graceful shutdown on "Connection: close"

After some long brainstorming sessions, it appears that "Connection: close"
seems to be the best signal from the L7 layer to indicate the need to close
the connection. Indeed, in H1 it is only present in very rare cases (eg:
certain unrecoverable errors, some of which could remove it now by the way).
It will also be added when the L7 layer wants to force the connection to
terminate. By default when running in keep-alive mode it is not present.
It's worth mentionning that in H1 with persistent connections, we have sort
of a concurrency-1 mux and this header field is used the same way.

Thus here this patch detects "Connection: close" in response headers and
if seen, sends a GOAWAY frame with the highest possible ID so that the
client knows that it can quit whenever it wants to. If more aggressive
closures are needed in the future, we may decide to advertise the max_id
to abort after the current requests and better honor "http-request deny".
src/mux_h2.c