Skip to content

Commit cc0cc7c

Browse files
committed
drop proxied socket when send/recv error
1 parent bd7c5b3 commit cc0cc7c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/shadowsocks-service/src/local/net/udp/association.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ where
457457
data.len(),
458458
err
459459
);
460+
461+
// Drop the socket and reconnect to another server.
462+
self.proxied_socket = None;
460463
}
461464
}
462465

crates/shadowsocks-service/src/local/tunnel/udprelay.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ impl UdpAssociationContext {
343343
data.len(),
344344
err
345345
);
346+
347+
// Drop the socket and reconnect to another server.
348+
self.proxied_socket = None;
346349
}
347350
}
348351

0 commit comments

Comments
 (0)