From 4e0e3c1e071fb9d9504fef248f7750a325c2a2cf Mon Sep 17 00:00:00 2001 From: 29 <791603901@qq.com> Date: Fri, 13 Dec 2024 17:27:29 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=97=EF=B8=8F=20Update=20experimental=20co?= =?UTF-8?q?de?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tracing-surreal/src/tmp/server.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tracing-surreal/src/tmp/server.rs b/tracing-surreal/src/tmp/server.rs index a715afd..a416865 100644 --- a/tracing-surreal/src/tmp/server.rs +++ b/tracing-surreal/src/tmp/server.rs @@ -16,7 +16,7 @@ use tokio::{ task::{JoinError, JoinHandle}, time::timeout, }; -use tokio_tungstenite::accept_async; +use tokio_tungstenite::{accept_hdr_async, tungstenite::handshake::server::Request}; use tokio_util::{sync::CancellationToken, task::TaskTracker}; #[derive(Debug, Copy, Clone)] @@ -256,7 +256,12 @@ impl ServerBuilder { println!("shutdown_waiter.cancelled()"); return; } - res = timeout(builder.ws_handshake_timeout, accept_async(stream)) => match res { + res = timeout( + builder.ws_handshake_timeout, + accept_hdr_async(stream, move |_req: &Request, res| { + Ok(res) + }), + ) => match res { Err(err) => { println!("outer_err: {}", err); return;