summaryrefslogtreecommitdiffstats
path: root/examples/tinyhttp.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2017-11-06 23:30:10 -0800
committerCarl Lerche <me@carllerche.com>2017-11-06 23:30:10 -0800
commit9c16d47632602611095f96bd370b05d197fb1156 (patch)
tree4aa86ef3f9b8b875e406cb8a7f8b17636ed77339 /examples/tinyhttp.rs
parenta402b1ca1eeeff4a5ee7dce886d1a848c9df28c6 (diff)
parent1fe55b2b5527fdd32ca7b8895cb5764f6ac0958f (diff)
Merge remote-tracking branch 'core/master' into new-crate
Diffstat (limited to 'examples/tinyhttp.rs')
-rw-r--r--examples/tinyhttp.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/tinyhttp.rs b/examples/tinyhttp.rs
index 2dddaf08..e0496928 100644
--- a/examples/tinyhttp.rs
+++ b/examples/tinyhttp.rs
@@ -62,9 +62,10 @@ fn main() {
}
let mut next = 0;
for socket in listener.incoming() {
- let socket = socket.expect("failed to accept");
- channels[next].unbounded_send(socket).expect("worker thread died");
- next = (next + 1) % channels.len();
+ if let Ok(socket) = socket {
+ channels[next].unbounded_send(socket).expect("worker thread died");
+ next = (next + 1) % channels.len();
+ }
}
}