File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ etherparse = "0.16"
2323futures = " 0.3"
2424rand = " 0.8"
2525spin = " 0.9"
26- smoltcp = { version = " 0.11 " , default-features = false , features = [
26+ smoltcp = { version = " 0.12 " , default-features = false , features = [
2727 " std" ,
2828 " log" ,
2929 " medium-ip" ,
Original file line number Diff line number Diff line change @@ -73,11 +73,11 @@ pub(super) struct VirtualRxToken {
7373}
7474
7575impl RxToken for VirtualRxToken {
76- fn consume < R , F > ( mut self , f : F ) -> R
76+ fn consume < R , F > ( self , f : F ) -> R
7777 where
78- F : FnOnce ( & mut [ u8 ] ) -> R ,
78+ F : FnOnce ( & [ u8 ] ) -> R ,
7979 {
80- f ( & mut self . buffer [ ..] )
80+ f ( & self . buffer [ ..] )
8181 }
8282}
8383
Original file line number Diff line number Diff line change @@ -200,7 +200,10 @@ impl TcpListenerRunner {
200200
201201 let before_poll = Instant :: now ( ) ;
202202 let updated_sockets = iface. poll ( before_poll, & mut device, & mut socket_set) ;
203- if updated_sockets {
203+ if matches ! (
204+ updated_sockets,
205+ smoltcp:: iface:: PollResult :: SocketStateChanged
206+ ) {
204207 trace ! ( "VirtDevice::poll costed {}" , Instant :: now( ) - before_poll) ;
205208 }
206209
@@ -499,6 +502,7 @@ impl AsyncWrite for TcpStream {
499502 cx : & mut Context < ' _ > ,
500503 buf : & [ u8 ] ,
501504 ) -> Poll < std:: io:: Result < usize > > {
505+ error ! ( "TcpStream::poll_write called with {} bytes" , buf. len( ) ) ;
502506 let mut control = self . control . lock ( ) ;
503507
504508 // If state == Close | Closing | Closed, the TCP stream WR half is closed.
You can’t perform that action at this time.
0 commit comments