mirror of
https://github.com/dndx/phantun.git
synced 2025-01-19 06:19:30 +08:00
fix(fake-tcp) more robust checking for receiving end closing, avoids
panicking tasks from causing server to stop completely
This commit is contained in:
parent
427fb7c19a
commit
41e86521b7
@ -385,9 +385,15 @@ impl Stack {
|
||||
|
||||
let tuple = AddrTuple::new(local_addr, remote_addr);
|
||||
if let Some(c) = tuples.get(&tuple) {
|
||||
c.send(buf).await.unwrap();
|
||||
if c.send(buf).await.is_err() {
|
||||
trace!("Cache hit, but receiver already closed, dropping packet");
|
||||
}
|
||||
|
||||
continue;
|
||||
|
||||
// If not Ok, receiver has been closed and just fall through to the slow
|
||||
// path below
|
||||
|
||||
} else {
|
||||
trace!("Cache miss, checking the shared tuples table for connection");
|
||||
let sender;
|
||||
|
Loading…
x
Reference in New Issue
Block a user