mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 17:34:45 +00:00
BUG/MINOR: mux-quic: prevent quic_conn error code to be overwritten
When MUX performs a graceful shutdown, quic_conn error code is set to a "no error" code which depends on the application layer used. However, this may overwrite a previous error code if quic_conn layer has detected an error on its side. In practice, this behavior has not been seen on production. In fact, it may have undesirable effect only if this error code modification happens between the quic_conn error detection and the emission of the CONNECTION_CLOSE, so it should be pretty rare. However, there is still a tiny possibility it may happen. To prevent this, first check that quic_conn error code is not set before setting it. Ideally, transport layer API should be adjusted to be able to set this without fiddling with the quic_conn directly. This should be backported up to 2.6.
This commit is contained in:
parent
4403cdf653
commit
b737f95009
@ -851,8 +851,12 @@ void qcc_emit_cc_app(struct qcc *qcc, int err, int immediate)
|
||||
tasklet_wakeup(qcc->wait_event.tasklet);
|
||||
}
|
||||
else {
|
||||
/* Only register the error code for graceful shutdown. */
|
||||
qcc->conn->handle.qc->err = quic_err_app(err);
|
||||
/* Only register the error code for graceful shutdown.
|
||||
* Do not overwrite quic-conn existing code if already set.
|
||||
* TODO implement a wrapper function for this in quic-conn module
|
||||
*/
|
||||
if (!(qcc->conn->handle.qc->flags & QUIC_FL_CONN_IMMEDIATE_CLOSE))
|
||||
qcc->conn->handle.qc->err = quic_err_app(err);
|
||||
}
|
||||
|
||||
TRACE_LEAVE(QMUX_EV_QCC_END, qcc->conn);
|
||||
|
Loading…
Reference in New Issue
Block a user