maybe working channels size
This commit is contained in:
@@ -3,6 +3,7 @@ use std::time::Duration;
|
||||
use bytes::Bytes;
|
||||
use netrunner_core::protocol::codec::frame::FrameType;
|
||||
use netrunner_core::protocol::codec::socks::TargetAddress;
|
||||
use netrunner_core::proxy::connection::BUF_SIZE;
|
||||
use netrunner_core::proxy::connection::muxer::{MuxMessage, Muxer};
|
||||
use smoltcp::iface::SocketHandle;
|
||||
use smoltcp::socket::tcp;
|
||||
@@ -44,7 +45,7 @@ impl TcpConnection {
|
||||
tokio::spawn(async move {
|
||||
// ИСПРАВЛЕНИЕ: Даем Муксеру ограниченный канал, как он и просит (тип mpsc::Sender)
|
||||
// Делаем его достаточно вместительным (1024)
|
||||
let (v_tx, mut v_rx) = mpsc::channel::<Bytes>(1024);
|
||||
let (v_tx, mut v_rx) = mpsc::channel::<Bytes>(BUF_SIZE);
|
||||
muxer.register_stream(stream_id, v_tx);
|
||||
|
||||
let connect_payload = target_addr.to_string();
|
||||
|
||||
@@ -358,7 +358,7 @@ impl ConnectionManager {
|
||||
}
|
||||
}
|
||||
pub fn setup_sockets(n_icmp: usize) -> SocketSet<'static> {
|
||||
let mut sockets = SocketSet::new(Vec::with_capacity(1024));
|
||||
let mut sockets = SocketSet::new(Vec::with_capacity(48));
|
||||
|
||||
for _ in 0..n_icmp {
|
||||
sockets.add(Self::create_icmp_socket());
|
||||
|
||||
@@ -47,7 +47,7 @@ impl Engine {
|
||||
let (mut device, to_smoltcp_tx, from_smoltcp_rx, avail) = VirtTunDevice::new(caps);
|
||||
let interface = Interface::new(config, &mut device, now);
|
||||
|
||||
let socket_set = ConnectionManager::setup_sockets(4);
|
||||
let socket_set = ConnectionManager::setup_sockets(2);
|
||||
let manager = ConnectionManager::new(dns_handler, muxer);
|
||||
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user