mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MINOR: mux-h2: do not prevent from sending a final GOAWAY frame
Some checks were added by commit 9a3d3fcb5 ("BUG/MAJOR: mux-h2: Don't try to send data if we know it is no longer possible") to make sure we don't loop forever trying to send data that cannot leave. But one of the conditions there is not correct, the one relying on H2_CS_ERROR2. Indeed, this state indicates that the error code was serialized into the mux buffer, and since the test is placed before trying to send the data to the socket, if the connection states only contains a GOAWAY frame, it may refrain from sending and may close without sending anything. It's not dramatic, as GOAWAY reports connection errors in situations where delivery is not even certain, but it's cleaner to make sure the error is properly sent, and it avoids upsetting h2spec, as seen in github issue #1422. Given that the patch above was backported as far as 1.8, this patch will also have to be backported that far. Thanks to Ilya for reporting this one.
This commit is contained in:
parent
3193eb9907
commit
e6dc7a0129
@ -3771,7 +3771,7 @@ static int h2_send(struct h2c *h2c)
|
||||
done = 1; // we won't go further without extra buffers
|
||||
|
||||
if ((conn->flags & (CO_FL_SOCK_WR_SH|CO_FL_ERROR)) ||
|
||||
(h2c->st0 == H2_CS_ERROR2) || (h2c->flags & H2_CF_GOAWAY_FAILED))
|
||||
(h2c->flags & H2_CF_GOAWAY_FAILED))
|
||||
break;
|
||||
|
||||
if (h2c->flags & (H2_CF_MUX_MFULL | H2_CF_DEM_MBUSY | H2_CF_DEM_MROOM))
|
||||
|
Loading…
x
Reference in New Issue
Block a user