ws: refactor, bug fixes, improvements (#155)

- split swarm worker into two modules
- split socket worker into two modules
- keep track of which offers peers have sent and only allow matching
answers
- always clean up after closing connection
- use channel for telling connections to close
- move some logic into new ConnectionRunner struct
- use slotmap for connection reference storage
- fix double counting of error responses
- actually close connections that take too long to send responses to
- remove announced_info_hashes entry on AnnounceEvent::Stopped
This commit is contained in:
Joakim Frostegård 2023-11-09 18:06:21 +01:00 committed by GitHub
parent af9d5a55f6
commit fe5ccf6646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 1770 additions and 1583 deletions

11
Cargo.lock generated
View file

@ -321,6 +321,7 @@ dependencies = [
"glommio",
"hashbrown 0.14.1",
"httparse",
"indexmap 2.0.2",
"log",
"metrics",
"metrics-exporter-prometheus",
@ -335,6 +336,7 @@ dependencies = [
"serde",
"signal-hook",
"slab",
"slotmap",
"socket2 0.5.4",
"tungstenite",
]
@ -2491,6 +2493,15 @@ dependencies = [
"autocfg",
]
[[package]]
name = "slotmap"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342"
dependencies = [
"version_check",
]
[[package]]
name = "smallvec"
version = "1.11.1"