all unbounded and remove AI hallucinations

This commit is contained in:
2026-04-12 15:14:42 +07:00
parent 9233641e67
commit 11b810ad65
16 changed files with 315 additions and 436 deletions
+6 -6
View File
@@ -79,8 +79,8 @@ impl DerefMut for TokenBuffer {
pub struct VirtTunDevice {
capabilities: DeviceCapabilities,
rx_queue: mpsc::Receiver<TokenBuffer>, // Входящие из TUN оставляем ограниченными (Backpressure)
tx_queue: mpsc::UnboundedSender<TokenBuffer>, // 🔥 ФИКС: Исходящие в TUN делаем БЕЗЛИМИТНЫМИ
rx_queue: mpsc::UnboundedReceiver<TokenBuffer>,
tx_queue: mpsc::UnboundedSender<TokenBuffer>,
rx_avail: Arc<AtomicBool>,
rx_bytes: u64,
@@ -102,12 +102,12 @@ impl VirtTunDevice {
capabilities: DeviceCapabilities,
) -> (
Self,
mpsc::Sender<TokenBuffer>,
mpsc::UnboundedSender<TokenBuffer>,
mpsc::UnboundedReceiver<TokenBuffer>,
Arc<AtomicBool>,
) {
let (to_smoltcp_tx, to_smoltcp_rx) = mpsc::channel(128);
let (from_smoltcp_tx, from_smoltcp_rx) = mpsc::unbounded_channel(); // 🔥 Безлимитный канал
let (to_smoltcp_tx, to_smoltcp_rx) = mpsc::unbounded_channel();
let (from_smoltcp_tx, from_smoltcp_rx) = mpsc::unbounded_channel();
let rx_avail = Arc::new(AtomicBool::new(false));
let now = StdInstant::now();
@@ -252,4 +252,4 @@ impl phy::TxToken for VirtTxToken<'_> {
let _ = self.0.tx_queue.send(buffer);
result
}
}
}