From 27a2028261d404747bbca59bc6c0d8a454f4c6fa Mon Sep 17 00:00:00 2001 From: yeoleobun Date: Thu, 25 Dec 2025 14:14:03 +0800 Subject: [PATCH 1/2] fix large future --- src/dialog/dialog.rs | 3 ++- src/dialog/invitation.rs | 3 ++- src/transport/stream.rs | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dialog/dialog.rs b/src/dialog/dialog.rs index 0aa8c9a0..a09c220f 100644 --- a/src/dialog/dialog.rs +++ b/src/dialog/dialog.rs @@ -15,6 +15,7 @@ use crate::{ transport::SipAddr, Result, }; +use futures::FutureExt; use rsip::{ headers::Route, message::HasHeaders, @@ -792,7 +793,7 @@ impl DialogInner { } pub(super) async fn do_request(&self, request: Request) -> Result> { - self.send_dialog_request(request).await + self.send_dialog_request(request).boxed().await } pub(super) fn transition(&self, state: DialogState) -> Result<()> { diff --git a/src/dialog/invitation.rs b/src/dialog/invitation.rs index 28068905..d083965d 100644 --- a/src/dialog/invitation.rs +++ b/src/dialog/invitation.rs @@ -14,6 +14,7 @@ use crate::{ transport::SipAddr, Result, }; +use futures::FutureExt; use rsip::{ prelude::{HeadersExt, ToTypedHeader}, Request, Response, @@ -430,7 +431,7 @@ impl DialogLayer { id: &id, }; - let r = dialog.process_invite(tx).await; + let r = dialog.process_invite(tx).boxed().await; self.inner .dialogs .write() diff --git a/src/transport/stream.rs b/src/transport/stream.rs index 62ff1630..5929cb4d 100644 --- a/src/transport/stream.rs +++ b/src/transport/stream.rs @@ -195,8 +195,7 @@ where let mut codec = SipCodec::new(); let mut buffer = BytesMut::with_capacity(MAX_SIP_MESSAGE_SIZE); - let mut read_buf = [0u8; MAX_SIP_MESSAGE_SIZE]; - + let mut read_buf = vec![0u8; MAX_SIP_MESSAGE_SIZE]; loop { use tokio::io::AsyncReadExt; match read_half.read(&mut read_buf).await { From c2d028fd59706ad0de622843780ebe61cfef97e5 Mon Sep 17 00:00:00 2001 From: yeoleobun Date: Thu, 25 Dec 2025 14:20:39 +0800 Subject: [PATCH 2/2] fix fmt error --- src/dialog/tests/test_client_dialog.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dialog/tests/test_client_dialog.rs b/src/dialog/tests/test_client_dialog.rs index df38122d..f0be7b1d 100644 --- a/src/dialog/tests/test_client_dialog.rs +++ b/src/dialog/tests/test_client_dialog.rs @@ -362,8 +362,7 @@ async fn test_make_request_preserves_remote_target_and_route_order() -> crate::R .expect("route-enabled request should resolve to a destination"); let expected_destination = Uri::try_from("sip:proxy2.example.com:5070;transport=tcp;lr")?; assert_eq!( - &*destination, - &expected_destination, + &*destination, &expected_destination, "First Route entry must determine the transport destination" );