Skip to content

Commit

Permalink
bugfix: local dns upstream udp packet buffer size 256 causes socket r…
Browse files Browse the repository at this point in the history
…eceive io error
  • Loading branch information
chuxi committed Dec 14, 2024
1 parent 13794f5 commit 79c84a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/shadowsocks-service/src/local/dns/upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl DnsClient {
let bytes = msg.to_vec()?;
socket.send(&bytes).await?;

let mut recv_buf = [0u8; 256];
let mut recv_buf = [0u8; 512];
let n = socket.recv(&mut recv_buf).await?;

Message::from_vec(&recv_buf[..n])
Expand All @@ -171,7 +171,7 @@ impl DnsClient {
let bytes = msg.to_vec()?;
socket.send_with_ctrl(ns, control, &bytes).await?;

let mut recv_buf = [0u8; 256];
let mut recv_buf = [0u8; 512];
let (n, _, recv_control) = socket.recv_with_ctrl(&mut recv_buf).await?;

if let Some(server_control) = recv_control {
Expand Down

0 comments on commit 79c84a1

Please sign in to comment.