When app layer has been shut, qcs_new() will immediately abort a new
stream via attach callback.
App proto hq-interop does not define shutdown callback. In this case, it
is expected that the app layer won't reject a new stream during attach.
MUX QUIC is thus responsible to shut the stream itself using
RESET_STREAM + STOP_SENDING.
This causes a protocol violation if the opened stream is unidirectional.
On RESET_STREAM emission, the peer may close the connection on fatal
error, aborting any possibly still active transfers. Fix this by
ensuring only STOP_SENDING is emitted in this case.
In practice, this bug is not encountered today as it only impacts
hq-interop protocol, and uni streams are not used in this case.
This must be backported to 3.4.
*/
if (qcc->app_st >= QCC_APP_ST_SHUT && !qcc->app_ops->shutdown) {
qcc_abort_stream_read(qcs, 0);
- qcc_reset_stream(qcs, 0, 0);
+ if (!quic_stream_is_uni(qcs->id))
+ qcc_reset_stream(qcs, 0, 0);
goto out;
}
else if (qcc->app_ops->attach && qcc->app_ops->attach(qcs, qcc->ctx)) {