Skip to content

Commit 1016540

Browse files
committed
Fix bug in interruptted write handling
1 parent c27a3d3 commit 1016540

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ async fn main() {
237237

238238
let timer = tokio::time::interval(Duration::from_secs(1));
239239
let mut ticker = stream::iter(0..max_tick).cycle().zip(timer);
240-
241240
let mut signals = signal_stream();
242241

243242
loop {
@@ -271,9 +270,9 @@ async fn main() {
271270
bytes += n as u64;
272271
connection.bytes += n as u64;
273272
connection.failed = 0;
274-
return true;
273+
true
275274
},
276-
Err(ref e) if e.kind() == std::io::ErrorKind::Interrupted => {},
275+
Err(ref e) if e.kind() == std::io::ErrorKind::Interrupted => { true },
277276
Err(mut e) => {
278277
if e.kind() == std::io::ErrorKind::WouldBlock {
279278
connection.failed += 1;
@@ -291,10 +290,10 @@ async fn main() {
291290
e,
292291
num_clients
293292
);
293+
294+
false
294295
}
295296
}
296-
297-
false
298297
});
299298
}
300299
Some(client) = listeners.next(), if num_clients < max_clients => {

0 commit comments

Comments
 (0)