aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-12-25 07:27:09 +0000
committermat <git@matdoes.dev>2024-12-25 07:27:09 +0000
commit8f0d0d92808286e92b7c8aea704be3c00f5afce4 (patch)
treefd3809cff3ae64f96fc75f54addb38306fbe77af /azalea-protocol/src
parent04eaa5c3d01a8f3a599a3a1abf7205eed80df4a2 (diff)
downloadazalea-drasl-8f0d0d92808286e92b7c8aea704be3c00f5afce4.tar.xz
close tcp connection on bot disconnect and add swarms to testbot cli
Diffstat (limited to 'azalea-protocol/src')
-rwxr-xr-xazalea-protocol/src/read.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs
index 6f9b754a..c324740f 100755
--- a/azalea-protocol/src/read.rs
+++ b/azalea-protocol/src/read.rs
@@ -230,7 +230,7 @@ pub async fn read_packet<P: ProtocolPacket + Debug, R>(
cipher: &mut Option<Aes128CfbDec>,
) -> Result<P, Box<ReadPacketError>>
where
- R: AsyncRead + std::marker::Unpin + std::marker::Send + std::marker::Sync,
+ R: AsyncRead + Unpin + Send + Sync,
{
let raw_packet = read_raw_packet(stream, buffer, compression_threshold, cipher).await?;
let packet = deserialize_packet(&mut Cursor::new(&raw_packet))?;
@@ -265,7 +265,7 @@ pub async fn read_raw_packet<R>(
cipher: &mut Option<Aes128CfbDec>,
) -> Result<Box<[u8]>, Box<ReadPacketError>>
where
- R: AsyncRead + std::marker::Unpin + std::marker::Send + std::marker::Sync,
+ R: AsyncRead + Unpin + Send + Sync,
{
loop {
if let Some(buf) = read_raw_packet_from_buffer::<R>(buffer, compression_threshold)? {
@@ -284,7 +284,7 @@ pub fn try_read_raw_packet<R>(
cipher: &mut Option<Aes128CfbDec>,
) -> Result<Option<Box<[u8]>>, Box<ReadPacketError>>
where
- R: AsyncRead + std::marker::Unpin + std::marker::Send + std::marker::Sync,
+ R: AsyncRead + Unpin + Send + Sync,
{
loop {
if let Some(buf) = read_raw_packet_from_buffer::<R>(buffer, compression_threshold)? {
@@ -355,7 +355,7 @@ pub fn read_raw_packet_from_buffer<R>(
compression_threshold: Option<u32>,
) -> Result<Option<Box<[u8]>>, Box<ReadPacketError>>
where
- R: AsyncRead + std::marker::Unpin + std::marker::Send + std::marker::Sync,
+ R: AsyncRead + Unpin + Send + Sync,
{
let Some(mut buf) = frame_splitter(buffer).map_err(ReadPacketError::from)? else {
// no full packet yet :(