BUG/MEDIUM: mux-h2: fix two half-closed to closed transitions
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Jan 2019 18:28:32 +0000 (19:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Jan 2019 18:34:40 +0000 (19:34 +0100)
commitfc10f599cc5e5606c15be4828848e04ed2c70f9c
tree249fac197f25934b9da01797e9f7026ab1a5d950
parentb1c9edc579aedd608107c4693c17160474b5ae62
BUG/MEDIUM: mux-h2: fix two half-closed to closed transitions

When receiving a HEADERS or DATA frame with END_STREAM set, we would
inconditionally switch to half-closed(remote). This is wrong because we
could already have been in half-closed(local) and need to switch to closed.
This happens in the following situations :
    - receipt of the end of a client upload after we've already responded
      (e.g. redirects to POST requests)
    - receipt of a response on the backend side after we've already finished
      sending the request (most common case).

This may possibly have caused some streams to stay longer than needed
at the end of a transfer, though this is not apparent in tests.

This must be backported to 1.9 and 1.8.
src/mux_h2.c