File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
crates/shadowsocks-service/src/server Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -414,11 +414,10 @@ impl UdpAssociationContext {
414414 let mut buffer = [ 0u8 ; MAXIMUM_UDP_PAYLOAD_SIZE ] ;
415415 loop {
416416 let ( n, addr) = match outbound. recv_from ( & mut buffer) . await {
417- Ok ( ( n, addr) ) => {
418- trace ! ( "udp relay {} <- {} received {} bytes" , self . peer_addr, addr, n) ;
417+ Ok ( r) => {
419418 // Keep association alive in map
420419 let _ = self . assoc_map . lock ( ) . await . get ( & self . peer_addr ) ;
421- ( n , addr )
420+ r
422421 }
423422 Err ( err) => {
424423 error ! (
@@ -430,13 +429,23 @@ impl UdpAssociationContext {
430429 }
431430 } ;
432431
432+ trace ! ( "udp relay {} <- {} received {} bytes" , self . peer_addr, addr, n) ;
433+
433434 let data = & buffer[ ..n] ;
434435
435436 let target_addr = match self . target_cache . lock ( ) . await . get ( & addr) {
436437 Some ( a) => a. clone ( ) ,
437438 None => Address :: from ( addr) ,
438439 } ;
439440
441+ trace ! (
442+ "udp relay {} <- {} ({}) with {} bytes" ,
443+ self . peer_addr,
444+ target_addr,
445+ addr,
446+ data. len( )
447+ ) ;
448+
440449 // Send back to client
441450 if let Err ( err) = self . inbound . send_to ( self . peer_addr , & target_addr, data) . await {
442451 warn ! (
You can’t perform that action at this time.
0 commit comments