File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -89,17 +89,23 @@ where
8989 } = self ;
9090 let mut socket = Pin :: new ( socket) ;
9191
92- while !protocol. outgoing_messages . is_empty ( ) {
92+ if !protocol. outgoing_messages . is_empty ( ) {
9393 trace ! (
9494 "found outgoing message to send checking if socket is ready"
9595 ) ;
96- if let Poll :: Ready ( Err ( e) ) = Pin :: as_mut ( & mut socket) . poll_ready ( cx)
97- {
98- // Sink errors are usually not recoverable. The socket
99- // probably shut down.
100- warn ! ( "netlink socket shut down: {:?}" , e) ;
101- self . socket_closed = true ;
102- return ;
96+ match Pin :: as_mut ( & mut socket) . poll_ready ( cx) {
97+ Poll :: Ready ( Err ( e) ) => {
98+ // Sink errors are usually not recoverable. The socket
99+ // probably shut down.
100+ warn ! ( "netlink socket shut down: {:?}" , e) ;
101+ self . socket_closed = true ;
102+ return ;
103+ }
104+ Poll :: Pending => {
105+ trace ! ( "poll is not ready, returning" ) ;
106+ return ;
107+ }
108+ Poll :: Ready ( Ok ( _) ) => { }
103109 }
104110
105111 let ( mut message, addr) =
Original file line number Diff line number Diff line change 3535 /// message, the stream is
3636 /// closed
3737 pub fn request (
38- & mut self ,
38+ & self ,
3939 message : NetlinkMessage < T > ,
4040 destination : SocketAddr ,
4141 ) -> Result < impl Stream < Item = NetlinkMessage < T > > , Error < T > > {
5959 }
6060
6161 pub fn notify (
62- & mut self ,
62+ & self ,
6363 message : NetlinkMessage < T > ,
6464 destination : SocketAddr ,
6565 ) -> Result < ( ) , Error < T > > {
You can’t perform that action at this time.
0 commit comments