File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -89,17 +89,23 @@ where
89
89
} = self ;
90
90
let mut socket = Pin :: new ( socket) ;
91
91
92
- while !protocol. outgoing_messages . is_empty ( ) {
92
+ if !protocol. outgoing_messages . is_empty ( ) {
93
93
trace ! (
94
94
"found outgoing message to send checking if socket is ready"
95
95
) ;
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 ( _) ) => { }
103
109
}
104
110
105
111
let ( mut message, addr) =
You can’t perform that action at this time.
0 commit comments