FIXME: buffer size too small

This commit is contained in:
ssrlive 2023-10-22 11:21:12 +08:00
parent 82739f693a
commit 75ae6e39e7

View file

@ -784,6 +784,12 @@ impl<'a> TunToProxy<'a> {
proxy_handler: Box<dyn ProxyHandler>, proxy_handler: Box<dyn ProxyHandler>,
udp_associate: bool, udp_associate: bool,
) -> Result<ConnectionState> { ) -> Result<ConnectionState> {
#[cfg(any(target_os = "linux", target_os = "android"))]
let mut socket = tcp::Socket::new(
tcp::SocketBuffer::new(vec![0; 1024 * 128]),
tcp::SocketBuffer::new(vec![0; 1024 * 128]),
);
#[cfg(any(target_os = "ios", target_os = "macos", target_os = "windows"))]
let mut socket = tcp::Socket::new( let mut socket = tcp::Socket::new(
// TODO: Look into how the buffer size affects IP header length and fragmentation // TODO: Look into how the buffer size affects IP header length and fragmentation
tcp::SocketBuffer::new(vec![0; 1024]), tcp::SocketBuffer::new(vec![0; 1024]),