Closed centny closed 1 year ago
Please include terminal output and trace logs.
found the reason, the send be closed twice. is it a issue? std tcp stream cant be close multi time
Quinn shouldn't panic. Can you provide a minimal reproduction?
yesterday,i split the minimal code and create test project to find the issue. uploaded to testquinncrash, follow readme, it can reproduce it.
now, i avoid it by add closed check.
pub struct WrapQuinnWriter {
inner: quinn::SendStream,
closed: bool,
}
#[async_trait]
impl RawWriter for WrapQuinnWriter {
async fn write(&mut self, buf: &[u8]) -> tokio::io::Result<usize> {
self.inner.write_all(buf).await?;
self.inner.flush().await?;
Ok(buf.len())
}
async fn shutdown(&mut self) {
// not check close will be crash
// if self.closed {
// return;
// }
self.closed = true;
_ = self.inner.shutdown().await;
}
}
I think this is a duplicate of https://github.com/quinn-rs/quinn/issues/1569. There's a fix drafted at https://github.com/quinn-rs/quinn/pull/1575.
connect