mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
unlike for H2 and H3, there is no mechanism in H1 to notify the client it must stop to upload data when a response is replied before the end of the request without closing the connection. There is no RST_STREAM frame equivalent. Thus, there is only two ways to deal with this situation: closing the connection or draining the request. Until now, HAProxy didn't support draining H1 messages. Closing the connection in this case has however a major drawback. It leads to send a TCP reset, dropping this way all in-fly data. There is no warranty the client has fully received the response. Draining H1 messages was never implemented because in old versions it was a bit tricky to implement. However, it is now far simplier to support this feature because it is possible to have a H1 stream without any applicative stream. It is the purpose of this patch. Now, when a shutdown is requested and the stream is detached from the connection, if the request is unfinished while the response was fully sent, the request in drained. To do so, in this case the shutdown and the detach are delayed. From the upper layer point of view, there is no changes. The endpoint is shut down and detached as usual. But on H1 mux point of view, the H1 stream is still alive and is being able to drain data. However the stream-endpoint descriptor is orphan. Once the request is fully received (and drained), the connection is shut down if it cannot be reused for a new transaction and the H1 stream is destroyed. |
||
---|---|---|
.. | ||
haproxy | ||
import | ||
make |