reset
on Connect
to immediately close streams
This commit is contained in:
parent
e264448ff0
commit
1278cd7398
@ -5,6 +5,7 @@ use bytes::{BufMut, Bytes};
|
||||
use futures_util::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
||||
use quinn::{
|
||||
Connection as QuinnConnection, ConnectionError, RecvStream, SendDatagramError, SendStream,
|
||||
UnknownStream, VarInt,
|
||||
};
|
||||
use std::{
|
||||
fmt::{Debug, Formatter, Result as FmtResult},
|
||||
@ -411,6 +412,15 @@ impl Connect {
|
||||
Side::Server(model) => model.addr(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reset(
|
||||
&mut self,
|
||||
error_code: VarInt,
|
||||
) -> (Result<(), UnknownStream>, Result<(), UnknownStream>) {
|
||||
let send_res = self.send.reset(error_code);
|
||||
let recv_res = self.recv.stop(error_code);
|
||||
(send_res, recv_res)
|
||||
}
|
||||
}
|
||||
|
||||
impl AsyncRead for Connect {
|
||||
|
Loading…
x
Reference in New Issue
Block a user