projects
/
learn-rust.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ccd093
)
simple-http: Naïve unlimited threads
author
Martin Pitt
<martin@piware.de>
Sat, 11 Sep 2021 09:36:22 +0000
(11:36 +0200)
committer
Martin Pitt
<martin@piware.de>
Sat, 11 Sep 2021 09:36:22 +0000
(11:36 +0200)
This introduces a DoS with too many parallel requests.
simple-http/src/main.rs
patch
|
blob
|
history
diff --git
a/simple-http/src/main.rs
b/simple-http/src/main.rs
index d2d0f8801302d343ebd36dd7a1875049feda4292..0993075332c1c2335f135f45f0b1c875d7b5a783 100644
(file)
--- a/
simple-http/src/main.rs
+++ b/
simple-http/src/main.rs
@@
-64,6
+64,6
@@
fn main() {
for stream in listener.incoming() {
let stream = stream.unwrap();
-
handle_connection(stream
);
+
thread::spawn(|| handle_connection(stream)
);
}
}